jamesatha
jamesatha

Reputation: 7600

Where is the java folder for libraries on linux

I need to find \jre\lib\ext under the java folder to add libraries. And I am not sure how to find it

Upvotes: 0

Views: 15319

Answers (2)

Joop Eggen
Joop Eggen

Reputation: 109547

As most comments say don't do so, the alternative.

Most applications have an app.jar and a lib folder in which all library jars reside. In the application jar there is a META-INF/MANIFEST.MF with a class path including the lib jars.

As a developer I use maven (like ant, ivy) for the build infra structure and it does it just so. The jars are taken from the local maven repository else from the remote ones. Also maven uses a local repository of all jars in different versions. Jars missing in the remote repositories, like own programming, can be installed there.

BTW /usr/lib/jvm/ contains the java versions (do which java, which javac).

Upvotes: 2

dinox0r
dinox0r

Reputation: 16039

Use String extDir = System.getProperty("java.ext.dirs"); to get the extensions dir path as you want (more info about system properties can be found here), set the path and write the jar files to that directory (be carefull to capture any IOException that could be raise in the writing process because this folders are usually write-protected or require root/admin privileges)

As quoted in the comments, this is something that should only be done in exceptional cases

Upvotes: 2

Related Questions