Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Runnable jar not working right
Runnable jar not working right [message #1735028] Tue, 14 June 2016 18:22 Go to next message
Henry Fan is currently offline Henry FanFriend
Messages: 2
Registered: June 2016
Junior Member
Hi There,

I tried to build MagicDraw sample source code in eclipse. Here are some problems:

I use eclipse Java Mars, If I run from eclipse, the MagicDraw project return 6 images, if I export the code to a jar file and run it, it returns different results:
1) If I export to "runnable Jar files" with Library handling - "Extract required libraries into generated JAR" or "Package required libraries into generated JAR", run my batch file, nothing generated. The code stuck in the main() function.
2) If I choose Library handling - "Copy required libraries into sub-folder next to the generated JAR", then the same project return Only 1 empty image file.

Here is my batch file -
java -Xmx1200M -Xss1024K ^
-Dproject_file="D:\AAA - MBSE\BatchTry\For_testing.mdzip" ^
-Ddestination_dir="D:\AAA - MBSE\BatchTry\BatchOut" ^
-jar imagegenerator.jar

Have no idea why this happening. Any idea?
Thanks.

Henry
Re: Runnable jar not working right [message #1735030 is a reply to message #1735028] Tue, 14 June 2016 19:17 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
One strategy for figuring out the difference is: after launching in Eclipse, open the debug view, select the second node from the top and open its properites (e.g, by Alt+Return). Here you will find the full command line used for that launch.

Next, what is the content of the jar using strategy (1)?

For your attempt (2) the batch file lacks a -classpath argument listing all the library jars.
Re: Runnable jar not working right [message #1735373 is a reply to message #1735030] Fri, 17 June 2016 20:17 Go to previous messageGo to next message
Henry Fan is currently offline Henry FanFriend
Messages: 2
Registered: June 2016
Junior Member
2) generated a sub directory includes all the requested JAR files and there is MANIFEST.MF file(which is in the Runnable Jar file) has the classpath. So I don't include the classpath in my batch file.
I think something wrong with eclipse Export functionality, the generated runnable Jar file is useless. I will run from class directly.
Thanks.

Henry
Re: Runnable jar not working right [message #1735404 is a reply to message #1735373] Sat, 18 June 2016 14:09 Go to previous message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
Sorry, but I don't think the information you provide suffices to understand what's going on / wrong.
See my questions / hints above, and:
- what's in your MANIFEST.MF
- what's the layout of jars in the filesystem
- from where do you try to launch it ...?
Previous Topic:64-bit Java not writing to Console tab
Next Topic:Cant install eclipse mars
Goto Forum:
  


Current Time: Mon Oct 14 21:16:48 GMT 2024

Powered by FUDForum. Page generated in 0.04099 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top