问题
I am using JDeveloper 11g to develop a desktop application. I want to make entire project jar which is run-able in java environment.. if I use only standard Java library jar works fine but my project contains external library like JfreeChart, Comm, Hibernate3 etc etc... when I try to make jar Its shows errors how can I make entire jar of my projects along with external library's.
thank you
回答1:
Please follow the below instructions..
- Right-click project and select properties.
- Click on Deployment, setup new Deployment by entering Deployment Profile type and name.
- Now edit Deployment profile on screen.
- Select Jar Options and specify your
main
class.
If you have 3rd party jar then follow
- Select File group the click on New.
- Select Dependency Analysis and Ok.
- Then select the Contributors under new file group you have created.
- Files tab for Files
- Libraries tab for Libraries, Include the Libraries you using in your project.
- Then Ok.
If you don't have 3rd party jar then ignore the above
- Then right-click on project, select the profile under deploy.
- Then Click finish to start deployment.
After finish deployment you see the jar in your project/deployment folder.
回答2:
Yes, you can do so. Have a look here - Java create standalone jar with external jars and also here - Put external library to the JAR?
The simple way is to use a tool, but you can use ant too, to recompile a set of JAR's into one big-fat JAR.
来源:https://stackoverflow.com/questions/10240703/build-java-entire-project-jar-using-jdeveloper