JNI_CreateJavaVM in debug mode

Hi,

on W2K using JDK1.3.1...

I tried, from my own executable, to launch a JVM in remote debug mode. My IDE for Java is Idea, so it provides me the arguments to provide to that function :

-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5000

the other JVM args are "-Xms150m","-Xmx150m", and the classpath to my jar (given as -Djava.class.path)

Note that I load the jvm.dll dynamically (using LoadLibrary()). I don't do any static linking...

The question is :

If I don't explicitly load the dt_socket.dll using LoadLibrary()

the JVM refuses to load, with the following message :

Transport dt_socket failed to initialize, rc = 509.

FATAL ERROR in native method: No transports initialized

if I use shared meme instead of tcp, I have a similar message :

Transport dt_shmem failed to initialize, rc = 509.

FATAL ERROR in native method: No transports initialized

Is there any additional args to provide to the JVM so that I don't have to explicitly load the dlls it requires ?

My goal is to be the as little dependant as possible from the brand/version/installation/Operating System of the JVM...

Thanks in advance.

C.Dore

[1325 byte] By [cdore] at [2007-9-26 14:19:34]
# 1
And what does your PATH look like?
jschell at 2007-7-2 15:56:08 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2

Good idea.

My path does not contain any JDK path, as I am testing my application against several JDKs (Sun 1.3, IBM 1.3, SUN 1.4Beta).

do you mean that I should try to add dynamically the path of the JDK before dlls are loaded ?

This would become a very OS-dependant issue..... (Ideally, my app should run also on Linux/ Solaris/... although I only unit-test on W2K so far)

cdore at 2007-7-2 15:56:08 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3

Well, as a second view, I don't beleive that the dlls that are missing are statically likned. Because the error message is not a Windows message :

Transport dt_socket failed to initialize, rc = 509.

FATAL ERROR in native method: No transports initialized

Thus, the required dlls should be search relatively to the path of the jvm.dll, or the the path of jdwp.dll

I consider this as a bug.

cdore at 2007-7-2 15:56:08 > top of Java-index,Java HotSpot Virtual Machine,Specifications...