This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes Eclipse 3.2.2 config for SWT / JFace Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Eclipse 3.2.2 config for SWT / JFace" Watch "Eclipse 3.2.2 config for SWT / JFace" New topic
Author

Eclipse 3.2.2 config for SWT / JFace

Olivier Cleyman
Greenhorn

Joined: May 29, 2005
Posts: 14
Hello,

I've almost never build a java application using GUI.
Always did Web Application.

So I'm trying to do my first java SWT / JFace app using Eclipse.

I did find quite a lot of tutorial really helpful but I still have problems configuring my project in Eclipse 3.2.2!

Can some one tell which specific jar in need to include in my project JAVA BUILD PATH in order to be able to run my SWT / JFace properly?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38472
    
  23
As long as you have the appropriate JRE set up in the Eclipse options, and the compatibility options set up correctly, you oughtn't to need a separate .jar at all.
Olivier Cleyman
Greenhorn

Joined: May 29, 2005
Posts: 14
I know that it is supposed to be quite straightforward....
But it doesn't work for me...

Can you detail me your JRE setup?

I have red somewhere that I needed to include jars in my project java build path.
C:\eclipse-2.1.0\plugins\org.eclipse.jface_2.1.0\jface.jar
C:\eclipse-2.1.0\plugins\org.eclipse.runtime_2.1.0\runtime.jar
C:\eclipse-2.1.0\plugins\org.eclipse.swt.win32_2.1.0\ws\win32\swt.jar
C:\eclipse-2.1.0\plugins\org.eclipse.ui.workbench_2.1.0\workbench.jar
C:\eclipse-2.1.0\plugins\org.eclipse.core.runtime_2.1.0\runtime.jar

The problem is that it is an old version of Eclipse and now the jars don't have the same name anymore.
So I put thoses ones...

\Eclipse\eclipse-SDK-3.2.2-win32\eclipse\plugins\org.eclipse.jface_3.2.2.M20061214-1200.jar
\Eclipse\eclipse-SDK-3.2.2-win32\eclipse\plugins\org.eclipse.swt.win32.win32.x86_3.2.2.v3236.jar
\Eclipse\eclipse-SDK-3.2.2-win32\eclipse\plugins\org.eclipse.swt_3.2.2.v3236b.jar
\Eclipse\eclipse-SDK-3.2.2-win32\eclipse\plugins\org.eclipse.ui.workbench_3.2.2.M20070119-0800.jar
\Eclipse\eclipse-SDK-3.2.2-win32\eclipse\plugins\org.eclipse.core.runtime_3.2.0.v20060603.jar
\Eclipse\eclipse-SDK-3.2.2-win32\eclipse\plugins\org.eclipse.core.runtime.compatibility_3.1.100.v20060603.jar

My classes compiles, but there are problems at runtime.

BTW my installed JRE is JRE1.6.0


Thanks a lot for your help
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38472
    
  23
Those aren't .jars for your project build path. If anything, they are .jars which underpin Eclipse. If your project compiles at all, that suggests it has all its .jars already.

I would suggest you repeat the download of Eclipse. You don't actually need to install it on Windows, since it is an executable .jar. All I did was to un-zip the downloaded file into an appropriate folder (C:\Program Files\Eclipse\Eclipse_3.2.2 will do nicely), then open the file with Windows Explorer. Find the "eclipse.exe" icon which is round and blue, R-click it and drag it onto your desktop. Then click "copy here" or "make shortcut here." You get an Eclipse icon on the Windows desktop which will start Eclipse when double-clicked.

I think this thread ought to be transferred to the IDEs forum . . .
Olivier Cleyman
Greenhorn

Joined: May 29, 2005
Posts: 14
Hummm

I just freshly installed Eclipse and I do know how to do it!

But if you don't include at least the SWT and JFace related jar in the project classpath it won't compile at all! I mean ma java classes with SWT and JFace code will not compile...the rest is fine of course.

That is why I added them... and that is also what all the tutorial on the subject says...

But in my case, and I don't know why, It will crash at runtime.

Anyway thanks a lot!
Suman Sharma
Ranch Hand

Joined: May 16, 2005
Posts: 72
Hi Olivier,
In Eclipse 3.1, I took following steps to configure Java Build Path to use SWT/JFace in one program.

Right click on .java program
select Build Path -> Configure Build Path
click on Libraries tab
click on Add External Jars

Then select 2 plugins:

org.eclipse.swt_3.1.0
org.eclipse.swt_win32.win32.x86_3.1.2

These get added to your libraries and your code should work.

I am looking for a online tutorial on SWL/Jface (not from help in eclipse environment). If you know about it, please let me know.

Thank you.

-Suman
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38472
    
  23
Sorry for my mistake about installation.
Olivier Cleyman
Greenhorn

Joined: May 29, 2005
Posts: 14
Thanks for the info!

I don't know why this still doesn't work with
org.eclipse.swt.win32.win32.x86_3.2.2.v3236.jar and
org.eclipse.swt_3.2.2.v3236b.jar

My SWT classes compiles but don't run...
My SWT JFace classes don't compile at all because the above jars don't contain JFace related classes.


For SWT I downloaded swt-3.2.2-win32-win32-x86.zip et install it as a Java project.
Then In my own Project I relate to this SWT project and then it does compile and run....

So SWT is OK now but not JFace....


For the tutorials, I just had a look at
http://www-128.ibm.com/developerworks/opensource/library/os-ecgui1/
http://www.developer.com/java/other/article.php/3330861

But I'm reading Manning SWT/JFace in action.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Eclipse 3.2.2 config for SWT / JFace