Can't Run Chapter 4 ListViewerExample

Tell us what you think about our book and report any errata. Sample chapters are available at http://www.qualityeclipse.com/

(Note: Previous Editions were called "Eclipse: Building Commercial Quality Plugins")

Moderators: Eric Clayberg, Dan Rubel

Can't Run Chapter 4 ListViewerExample

Postby dextercowley » Mon Mar 03, 2008 3:29 pm

Hi. There are several problems with trying to run the JFace examples (e.g., ListViewerExample on page 194).

1. The book says to import 4 jar files: org.eclipse.core.runtime, jface, jface.text, and text. However, evidently, you also need at least two others: org.eclipse.core.boot and core.commands.

2. When you the First Project (for version for 3.3), the external libraries all point to older versions of these jar files (e.g., org.eclipse.core.boot_3.1.100.v20060601a.jar instead of the 3.3 version).

3. When I manually add all of the correct jar versions, the project builds cleanly with no problems. However, when I try to run ListViewerExample, I get a NoClassDefFoundError: org/eclipse/core/runtime/ISafeRunnable. So it would appear that I need at least one more jar file to be able to run this example.

Any help you might provide will be appreciated. Thanks. Mark Dexter
dextercowley
 
Posts: 5
Joined: Wed Feb 27, 2008 5:17 pm

Re: Can't Run Chapter 4 ListViewerExample

Postby dextercowley » Mon Mar 03, 2008 4:11 pm

I believe I solved the problem by adding one more jar: org.eclipse.equinox.common. So the final list is (all starting with org.eclipse): core.commands, equinox.common, jface, jface.text, and text.

In your sample project, you also list the SWT jar (swt.win32.win32.x86 for me). However, in the book you have us import the SWT project org.eclipse.swt and add that project to the required projects.

I hope this will help anyone else trying to use this book with Eclipse 3.3. I'm surprised others haven't hit this problem before.
dextercowley
 
Posts: 5
Joined: Wed Feb 27, 2008 5:17 pm

Re: Can't Run Chapter 4 ListViewerExample

Postby Dan Rubel » Mon Mar 03, 2008 10:47 pm

Thanks for your feedback.

dextercowley wrote:The book says to import 4 jar files: org.eclipse.core.runtime, jface, jface.text, and text. However, evidently, you also need at least two others: org.eclipse.core.boot and core.commands.


Noted and corrected.

dextercowley wrote:2. When you the First Project (for version for 3.3), the external libraries all point to older versions of these jar files (e.g., org.eclipse.core.boot_3.1.100.v20060601a.jar instead of the 3.3 version).


For convenience, I converted the "Chapter 4 SWT and JFace" examples that you import using the "QualityEclipse Book Samples" to a plug-in project so that the PDE will automatically resolve and manage the JAR references regardless of which version of Eclipse you are using. This will be part of the revised book samples available around the time of EclipseCon

dextercowley wrote:3. When I manually add all of the correct jar versions, the project builds cleanly with no problems. However, when I try to run ListViewerExample, I get a NoClassDefFoundError: org/eclipse/core/runtime/ISafeRunnable. So it would appear that I need at least one more jar file to be able to run this example.


Good point... fixed and part of the next version of our book.
Dan Rubel
Moderator
 
Posts: 27
Joined: Thu Oct 30, 2003 9:13 am


Return to Book: Eclipse Plug-Ins (3rd Edition)

Who is online

Users browsing this forum: No registered users and 1 guest