When I convert a Java project to a .jar with BlueJ, the project doesn't work as it does straight from BlueJ -


i use "create jar file..." option , choose main class. when try execute program jar, joptionpane window show up, program end there , not show jframe. have tried putting jar inside project folder , running there, of objects not draw when start it. there doing wrong or fix problem?

i had similar problem first .jar exported bluej. resolved executing jar via command line addition of -jar flag (java -jar myprogram.jar). -jar flag tells launcher it's dealing .jar archive, rather being invoked run class file. assuming java installed on machine can way, via 'run' dialog in windows. if you're not totally comfortable command line interfaces it'd easiest give 'absolute path' - on windows put .jar in c:\ , java -jar c:\yourthing.jar via 'run' dialog. take @ docs java launcher, they're pretty easy going: http://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html

if want able double-click .jar, answer little more fiddly. have read of other question (running jar file on windows) people have provided variety of different ways of doing it, none of can vouch i'm sure work.


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -