JavaCall.jl icon indicating copy to clipboard operation
JavaCall.jl copied to clipboard

jar-file inside jar-file

Open KenziTrader opened this issue 6 years ago • 2 comments

I have a jar-file which packages its libraries in a lib-directory inside itself. The MANIFEST.MF inside the jar allows the libraries to be found.

When I call a class from the jar the library inside it is not found and I get java.lang.NoClassDefFoundError. I have to extract the lib-directory and add it manually to the class path.

How can I add jar-file inside a jar-file to the class path in JavaCall.jl?

KenziTrader avatar Jul 24 '18 12:07 KenziTrader

How would it work if you were running java directly? Does java -cp outerfile.jar SomeClass work? Can you provide a working example for me to try out?

aviks avatar Jul 26 '18 10:07 aviks

There is an example which uses a custom class loader:

Deliver Your Java Application in One-JAR!

There is a very old bug report: JDK-4648386.

KenziTrader avatar Jul 26 '18 10:07 KenziTrader