0

Hi, I am developing an application in Java. I have to run that jar in different Operating Systems, such as winxp, linux, rhel, Ubuntu.

I have some jar files that must be in the classpath.

The client is not ready to set the path, so I have to set it programmatically.

My problem is with the different Operating Systems, because the user will have different paths. How can I get the path through a config file?

How do I manage OS and these dependencies?

Any idea if I can set the path at runtime?

Raul Rene
  • 10,014
  • 9
  • 53
  • 75
R4U
  • 31
  • 2

1 Answers1

1

You should package all the jars your program depends inside your executable jar. In your project create lib directory and push all the dependencies inside. This will save you lot of pain.

If you use Maven2 , you can do something like this in your pom.xml. In case you build from IDE (Eclipse or IntelliJ etc) you can use the wizard: R.click your project root -> Export -> Runnable JAR etc .

Community
  • 1
  • 1
aviad
  • 8,229
  • 9
  • 50
  • 98