[solved]Problem with getting started - swt is not built [message #908045] |
Tue, 04 September 2012 11:42  |
Eclipse User |
|
|
|
Hi,
I have problems with starting using java2script and SWT. When I use only Java2Scipt everything seems to be fine, as well as using SWT. But when I have project with SWT and then I want to change Java Build Path and add SWT as project, then this problem appears:
The project cannot be built until its prerequisite org.eclipse.swt.gtk.linux.x86 is built. Cleaning and building all projects is recommended
I cleaned both projects and nothing was changed. I use Eclipse 3.5.2. Have you any ideas, where is the problem and how to solve it?
This is what I exactly did:
1) Downladed and installed Java2Script (moving files to %eclipse%/plugin directory).
2) Downloaded SWT.
3) Created New project
package my.first.program;
public class FirstClass {
/**
* @param args
*/
public static void main(String[] args) {
System.out.println("Hello world");
}
}
4) In project Properties - changed Java2Script compiler to enabled.
5) Imported SWT as a project in the package view.
6) In project Properties - added SWT as a resource.
7) Tried to run application as Java2Script Application
[Updated on: Wed, 05 September 2012 15:54] by Moderator
|
|
|
Re: Problem with getting started - swt is not built [message #908682 is a reply to message #908045] |
Wed, 05 September 2012 15:52  |
Eclipse User |
|
|
|
Ok, problem solved.
Instead of using Eclipse 3.5.2, I've just used Eclipse 3.6.2 and appropriate J2S and now it works. Here are steps, that I took (huge thanks to my teacher, if he reads, for giving me the solution):
1) Downloaded and unpacked eclipse-SDK-3.6.2-win32.zip.
2) Downloaded and unpacked plugin j2s-2.0.0-20100601-eclipse-3.6.zip, copied 'plugin' directory to eclipse and ran eclipse -clean
3) New Java2Script SWT project
4) New class:
import org.eclipse.swt.widgets.*;
public class MyApp {
public static void main(String[] args){
Display display = new Display();
Shell shell = new Shell(display);
shell.setText("Hello world");
shell.open();
while(!shell.isDisposed())
if(!display.readAndDispatch())
display.sleep();
display.dispose();
}
} 5) Run project with green button (if you use 'Run as...' you can have problems with generating script)
6) Et voila, everything works.
|
|
|
Powered by
FUDForum. Page generated in 0.49916 seconds