Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Generated JAR doesn't contain dependent libraries
Generated JAR doesn't contain dependent libraries [message #875888] Wed, 23 May 2012 13:55 Go to next message
Preston Arquette is currently offline Preston ArquetteFriend
Messages: 5
Registered: May 2012
Junior Member
I'm working on a Java-only project utilizing JARs from the Java Core, as well as things from the Processing core. When I export my project to a JAR, the resulting JAR contains my single test class (which is all there currently is) and a manifest file. Without bundling the Processing data into the archive, I can't run this JAR on an external machine. How do I tell Eclipse to bundle in the dependent JARs?
Re: Generated JAR doesn't contain dependent libraries [message #875898 is a reply to message #875888] Wed, 23 May 2012 14:07 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

I'm assuming you are talking straight Java application and not an
Eclipse application. Eclipse applications are different.

That's not standard for Java Apps. Java can't access code from jars
within jars. And it is not normal to break open dependent jars and
extract the contents and put them all into the same jar.

Usually you would deliver all of the jars and put them on the classpath.
Or even better is have your manifest of the top level jar put a
Class-Path in it specifying the dependent jars. Then if there are all in
the same folder then you only need to put the top level jar on the
classpath and the others will be pulled in.

Rich
Re: Generated JAR doesn't contain dependent libraries [message #875901 is a reply to message #875888] Wed, 23 May 2012 14:12 Go to previous messageGo to next message
Satyam Kandula is currently offline Satyam KandulaFriend
Messages: 444
Registered: July 2009
Senior Member
Try creating a 'Runnable Jar'.
Re: Generated JAR doesn't contain dependent libraries [message #875935 is a reply to message #875901] Wed, 23 May 2012 15:28 Go to previous messageGo to next message
Preston Arquette is currently offline Preston ArquetteFriend
Messages: 5
Registered: May 2012
Junior Member
The wizard gives me no "launch options" and so I cannot proceed in it.

I should have been more clear: the idea of this project is to build embeddable applets, so the referenced libraries somehow need to come with it.
Re: Generated JAR doesn't contain dependent libraries [message #876448 is a reply to message #875898] Thu, 24 May 2012 15:57 Go to previous messageGo to next message
Preston Arquette is currently offline Preston ArquetteFriend
Messages: 5
Registered: May 2012
Junior Member
How do I do that?
Re: Generated JAR doesn't contain dependent libraries [message #876937 is a reply to message #876448] Fri, 25 May 2012 14:48 Go to previous messageGo to next message
Satyam Kandula is currently offline Satyam KandulaFriend
Messages: 444
Registered: July 2009
Senior Member
Did you try creating a launch configuration?
Re: Generated JAR doesn't contain dependent libraries [message #877014 is a reply to message #876937] Fri, 25 May 2012 18:03 Go to previous messageGo to next message
Preston Arquette is currently offline Preston ArquetteFriend
Messages: 5
Registered: May 2012
Junior Member
I believe that I have created one. Is it under "run configurations"?
Re: Generated JAR doesn't contain dependent libraries [message #877442 is a reply to message #877014] Sat, 26 May 2012 18:37 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
Preston Arquette wrote on Fri, 25 May 2012 20:03
I believe that I have created one. Is it under "run configurations"?


Yes.

I guess it has to be a launch configuration for a "Java Application" in order to be offered in the export wizard. So maybe this approach doesn't work for Applets. I dunno.

Stephan
Re: Generated JAR doesn't contain dependent libraries [message #877449 is a reply to message #877442] Sat, 26 May 2012 19:04 Go to previous messageGo to next message
Preston Arquette is currently offline Preston ArquetteFriend
Messages: 5
Registered: May 2012
Junior Member
Can you then offer an explanation as to how I can export my applet to a JAR in such a way that it will run when I embed it into my website?
Re: Generated JAR doesn't contain dependent libraries [message #878423 is a reply to message #877449] Tue, 29 May 2012 09:24 Go to previous message
Satyam Kandula is currently offline Satyam KandulaFriend
Messages: 444
Registered: July 2009
Senior Member
Write an ant file to jar the required files.
Previous Topic:Failing to create JVM, but I have more than enough RAM
Next Topic:JSF components and EL expressions in XHTML page
Goto Forum:
  


Current Time: Fri Mar 29 15:07:33 GMT 2024

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

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

Back to the top