Hi I am having a bit of trouble setting the correct classpath for jar files in JNI.
I have a standalone Java class
myClass
which uses a jar file
mjar.jar
. This class can be used from a main "mainClass fine.
myClass
builds fine
I make and build the
mainClass
using a batch file.
SET ROOT_DIR=D:\myDocs
SET CP=.
SET CP=%CP%;%ROOT_DIR%\myjar.jar
javac -g -classpath %CP% mainClass.java
SET ROOT_DIR=D:\myDocs
SET CP=.
SET CP=%CP%;%ROOT_DIR%\myjar.jar
java -classpath %CP% mainClass
All that works fine.
However when I reuse myClass in a JNI c file, the JNI cant find the class. There is not a problem with the origional JNI code as If I remove the jar stuff in
myCLass
, the JNI code finds the myClass and workes fine.
So the problem is that I am unsure how to set the class path for JNI code in C to find/include the Jar files