It's not a secret anymore!
The moose likes Java in General and the fly likes JAVA_TOOL_OPTIONS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General


Venkat Eturi

Joined: Jun 19, 2010
Posts: 1
Hi All,

I have java and qtp 9.5 on my computer.
When I created a small "Hello World" to compile,
javac gives an error message : Picked Up JAVA_TOOLS_OPTIONS: -agentlib:jvmhook

How to compile java the normal way?

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46328
Welcome to the Ranch and sorry for not replying earlier; I have been very busy. How did you get that error message; I have never seen it before. How are you compiling your hello world program?
D. Ogranos
Ranch Hand

Joined: Feb 02, 2009
Posts: 214
I realize this is an old thread, but when searching I found a similar question which also had not been answered, and since I just learned about this I thought I might reply so people can find an answer when they search for this

JAVA_TOOL_OPTIONS is an environment variable you can set to pass arguments to the Java Virtual Machine (and apparently also javac). If the variable is set, its content is printed out as mentioned by the OP. So this is no error, just debugging info. It can be used for command line options (like -enableassertions) and also to set system properties (like -Dmyvar=myvalue), which you can then query through System.getProperty().

Its use is for when you have no command line available when starting the JVM, or also starting from scripts.

From a quick test, this works for Java 1.5 and up.

Link to Oracle Doku: Environment Variables.
I agree. Here's the link:
It's not a secret anymore!