This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Java in General and the fly likes build jar file that includes needed classes automatically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "build jar file that includes needed classes automatically" Watch "build jar file that includes needed classes automatically" New topic
Author

build jar file that includes needed classes automatically

Steve Deadsea
Ranch Hand

Joined: Dec 03, 2001
Posts: 125
A few years ago I could have sworn that I read about a jar creation tool that would automatically discover what class files would be needed for a application and build a jar file with just those class files. I believe that you provided it with the name of the class or classes that had entry points (main methods) and it would see what they depended on usiing static analysis. It would look at both things that were compiled as dependencies and things that might be dependencies because of strings that looked like class names to load via reflection.

Such a tool would be really useful to me now, but I can't seem to find it on Google right now. Is anybody familiar with it?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18155
    
    8

That's Maven, isn't it? Although as I understand it, it doesn't build a single jar file, it collects the other jars you need and builds something which can be distributed.
Steve Deadsea
Ranch Hand

Joined: Dec 03, 2001
Posts: 125
I thought that maven worked at the jar level, not at the class level. No?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: build jar file that includes needed classes automatically
 
Similar Threads
Using Eclipse 3.1.0 IDE, JBOSS 4.0.0 server & ANT as build tool
eclipse - error with exporting jar
how to create WAR files
organizing classes into packages
merge multiple jars into one jar?