[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    How to dynamically attach using JRE's java.exe?
From:       Mandy.Chung () Sun ! COM (Mandy Chung)
Date:       2008-05-16 16:14:51
Message-ID: 482DB2FB.60708 () sun ! com
[Download RAW message or body]

Hi Bastian,

The attach API is in the JDK/lib/tools.jar.  So you will need to set the 
classpath to include tools.jar (e.g. java -classpath 
$JDK_HOME/lib/tools.jar YourApp).

You can refer to the example described in Alan Bateman's blog:
   http://blogs.sun.com/alanb/entry/another_piece_of_the_tool

Hope this helps.
Mandy

Bastian Helfert wrote:
> Hello everybody,
>
> I apologize for posting my question to this mailing list, but is there 
> anyone who can help me, please?
>
> How can I execute
>
>    VirtualMachine.attach(pid);
>
> by using the java app launcher of the JRE for Windows (i.e. instead of 
> the java.exe that ships with the JDK)?
>
> I have tried to set:
>
>    -Djava.library.path=%JDK_HOME%\jre\bin\attach.dll
>
> and also
>
>    
> -Dcom.sun.tools.attach.spi.AttachProvider=sun.tool.attach.WindowAttachProvider
>
> which possibly is nonsense, but I still receive the error:
>
>    java.lang.UnsatisfiedLinkError: no attach in java.library.path
>    Exception in thread "main" 
> com.sun.tools.attach.AttachNotSupportedException: no providers installed
>        at 
> com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:190)
>        ...
>
> Has anyone a solution to this (besides using the JDK's java.exe)? If 
> so: What libraries / properties do I need to provide / set and how? 
> What else do I need to do and how?
>
> Thank you very much in advance,
> Bastian



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic