swt application running
hello ! I'm new to SWT and have written just a few simple programs, but execute them outside the IDE is problematic :( i simply export the project from eclipse3.1.2 , add manifest.mf where point Class-Path and Main-Class , then i put the jar with needed resources in the same folder, that's it !
But when double-clicking on myApp.jar the console is shown and immediately disappears, however from cmd it works well ! Please suggest me what to do !!!!!! :confused:
What OS are you on? The quick flashing screen means that java gets an error trying to open the jar file.
Is the OS executing a different commandline than you are?
If you are on Windows, you can look in the Registry for the commandline used to open a jar file. Or you can use windows explorer Tools|Folder Options|FileTypes -> scroll down to the JAR entry, edit it(Advanced butteon) and look at the open entry (or the one that is hi-lited). The commandline will be the 2nd one: application used to perform...
Is that what you use?
hi ! you was right! thank you very much, now it works well !
Originally Posted by Norm
but one problem still remains : i have two files , swt.jar and myApp.jar, so can i put swt.jar into myApp.jar so that myApp.jar is run properly, I tried , but it didn't work! ( if Class-Path: swt.jar means that swt.jar is in the same folder, then Class-Path :myApp.swt.jar must be meant that swt.jar is in the myApp.jar, yes? )
The java program doesn't know what to do with a jar file inside of another jar file. You'll have to use the Class-path: statement and have the other jar file in the same folder.