This week's book giveaway is in the OCP forum.
We're giving away four copies of OCP Java SE 8 Programmer II Exam Study Guide and have Kathy Sierra, Bert Bates, & Elizabeth Robson on-line!
See this thread for details.
Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Where to place jar files for deployment?  RSS feed

 
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys! If you're creating a standalone app. Where should third-party jar files that you used be placed? Using the classpath seems illogical since you usually won't have control over the user's machine. Thanks!
 
Java Cowboy
Sheriff
Posts: 16083
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can place them anywhere you like. The best place is probably to put them in the same directory as the JAR file of your application. you should supply a batch file or shell script with your program that starts it up with the right classpath, that looks something like this:

java -cp MyJar.jar;thirdparty.jar;somethingelse.jar com.mycompany.mypackage.MyMainClass

You could also make your JAR an executable JAR file (see the tutorial for more info), in which case you specify the classpath for your application in the manifest file in the JAR.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!