Jump to content
Excelsior Forums
Sign in to follow this  

What is the correct location of runtime-provided JARs?

Recommended Posts

I have a JET-compiled application running on a Windows machine which I would like to provide plugins for at runtime.

Ideally this would be done by placing a JAR in a specific location before starting the application, and then having it loaded to the classpath when the application starts.

From what I've read in the manual re: MCM, I understand that this should be possible; if so, where should the JAR be located?

Share this post

Link to post
Share on other sites

Excelsior JET supports standard Java SE dynamic class loading.

For your case, I see several options:

1) Specify jar files in classpath as usual. If they are present at run time, they will be picked by standard application class loader and classes will be loaded.

2) Use Java extensions mechanism. You can drop your jar files into default extensions dir (<JET_HOME>/profile<Java version>/jre/lib/ext for development system or <APP_ROOT>/rt/lib/ext after deployment). Extensions directory can be overridden with java.ext.dirs system property. Note that you can set paths in system properties relative to application ${Root} in JetPackII.

3) Write your own custom class loader, or use one of the existing, such as java.net.URLClassLoader.

Note that all dynamically loaded classes are JIT-compiled, so be sure to check JIT options: selection of fast vs. optimizing JITs, JIT caching etc.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this