Monday 10 June 2019

Java: How to make the APIs available to all applications


Approach 1: Place the jar file in global classpath.

Approach 2: Place the jar file in ext directory of jre installation.

When java application starts, jre checks for the classes in core system classes (rt.jar file, which is located in jre lib), ext directory of jre and folders from classpath.

In MAC, you can find the ext directory location from here.
/Library/Java/JavaVirtualMachines/{JAVA_VERSION}/Contents/Home/jre/lib/ext

Previous                                                 Next                                                 Home

No comments:

Post a Comment