The Artima Developer Community
Sponsored Link

Java Answers Forum
-Xrunjcov option

1 reply on 1 page. Most recent reply: Nov 15, 2006 12:18 PM by Paul Bouché

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Paul Reiners

Posts: 8
Nickname: reiners
Registered: Mar, 2003

-Xrunjcov option Posted: Jan 6, 2006 1:37 PM
Reply to this message Reply
Advertisement
I'm trying to run a java option as described in Bruce Eckel's book, Thinking in Java:

To get coverage testing information for SimpleDebugging.java, you use the command:


java –Xrunjcov:type=M SimpleDebugging


However, when I do that, I get the following error:

Error occurred during initialization of VM
Could not find agent library on the library path or in the local directory: jcov

Anybody know what's going wrong here?

Note that this is the error I get with the JDK 1.5. I also tried it with the JRE 1.4, but got a different (longer) error message.

Also, when I run


java SimpleDebugging


(i.e., without the option), everything works fine.


Paul Bouché

Posts: 1
Nickname: mat6rix33
Registered: Nov, 2006

Re: -Xrunjcov option Posted: Nov 15, 2006 12:18 PM
Reply to this message Reply
Hallo,

auf http://java.sun.com/j2se/1.5.0/docs/guide/jvmpi/jvmpi.html
steht folgendes:
=================
1.1. Start-up
The user can specify the name of the profiler agent and the options to the profiler agent through a command line option to the Java virtual machine. For example, suppose the user specifies:

java -Xrunmyprofiler:heapdump=on,file=log.txt ToBeProfiledClass

The VM attempts to locate a profiler agent library called myprofiler in Java's library directory:

* On Microsoft Windows, it is [value of java.home property]\bin\myprofiler.dll
* On SPARC/Solaris, it is [value of java.home property]/lib/sparc/libmyprofiler.so

If the library is not found in the Java library directory, the VM continues to search for the library following the normal library search mechanism of the given platform:

* On Microsoft Windows, the VM searches the current directory, Windows system directories, and the directories in the PATH environment variable.
* On Solaris, the VM searches the directories in LD_LIBRARY_PATH.

The VM loads the profiler agent library and looks for the entry point:

jint JNICALL JVM_OnLoad(JavaVM *jvm, char *options, void *reserved);

The VM calls the JVM_OnLoad function, passing a pointer to the JavaVM instance as the first argument, and string "heapdump=on,file=log.txt" as the second argument. The third argument to JVM_OnLoad is reserved and set to NULL.

On success, the JVM_OnLoad function must return JNI_OK. If for some reason the JVM_OnLoad function fails, it must return JNI_ERR.
============

Ergo ist es nicht die -Xrunjcov sondern die -Xrun Option, die aber veraltet ist. Der Profiler jcov kann also von der Java VM nicht gefunden werden. In den entsprechenden Pfad herein tun, sollte helfen. Wo man jcov her bekommt weiß ich gerade auch nicht ;-)

(Google hätte die Frage aber auch beantwortet ;)

Paul

Flat View: This topic has 1 reply on 1 page
Topic: -Xrunjcov option Previous Topic   Next Topic Topic: Coding Dojo

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use