tags:

views:

82

answers:

4

I created a Hello World SWT application using Eclipse and I was able to run it from Eclipse (everything works fine). But I wonder how other peoples (users) will run this kind of application. Should they install Eclipse, import my project and run it? It sounds strange.

A: 

You have to run the class file with the main method. example: java testMain.class

maybe you have to specify a classpath

u2ix
Do you mean that I can ran *.class file, generated by Eclipse, by typing "java className.class" in the command line? I tired that and it did not work.
Roman
yes, that's what he meant. But you need to be in the right working directory and in case your class is not in the default package you need to specify your package, too. E.g. `java com.mypackage.className.class`
Stroboskop
@u2ix, @Stroboskop: you never specify the `.class` on the `java` command line.
Joachim Sauer
@Roman: please define "did not work". What error did you get? You must have SWT on the classpath of course.
Joachim Sauer
A: 

Please, see my last answer on your previous question

St.Shadow
A: 

If you are delivering it to somebody else, then you have to create an executable jar, with mentioning your main class(ie a public class with main() method in it) in the jar's manifest file as the Main-Class. So when prople double click it or type: jar "your jar name" in command console then they will get it executed.

GK
This is generally true of Java - but since this is SWT - he'll also need to handle packaging / providing the native SWT libraries.
Nate