How to add java's classpath with command line arguments?

I wan’t to import some native libraries to Oxygene Java

it requires something like this in command line
java -Djava.class.path=.;C:/abc/abc.jar test.jar

how should i do it?

thank you.

There’s no need to do that if you set the “Copy Local” property to true on the .jar file reference in the “References” node.

hmm…

I need to load a native .dll library on windows.
so i must call System.loadLibrary(“dllname”);

it is ok only when i give the dll full path not relative path.

even java’s environment variable seems not work when i debug from Visual Studio.

Thank you.

That’s curious. When the .dll is in the target jar, the copy local trick should do exactly the same as passing it via the command line. You can still use a custom start executable in Java, but then it will pass the arguments in two env vars:

JRE_HOME
JAVA_OPTS

You’d need to create a batch file like:

@echo off
%JRE_HOME%\bin\java %JAVA_OPTS% -Djava.class.path=....  -jar myjar.jar

and use that as “Start application”