ibexy
ibexy

Reputation: 611

Error message in trying to run java

Am getting the following error message while trying to run java. I have typed in java -version but am getting error:

C:\>java -version
Picked up _JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:C:\PROGRA~1\HP\QUICKT~1\
bin\JAVA_S~1\classes;C:\PROGRA~1\HP\QUICKT~1\bin\JAVA_S~1\classes\jasmine.jar
Error occurred during initialization of VM
Could not find agent library jvmhook on the library path, with error: Can't find
 dependent libraries

Upvotes: 6

Views: 21810

Answers (3)

TRIDIB BOSE
TRIDIB BOSE

Reputation: 391

I'm using Intellij IDE. Removing .idea folder from project's local directory solved this issue.

Upvotes: 0

user2909557
user2909557

Reputation: 59

Java is being invoked in a slightly abnormal way.

I have multiple answers depending on your Java version number and whether or not you wish to perform automated testing on your computer.

HP's Quick Test Professional (QTP, an automation tool) has been installed on your computer; this is the program which creates _JAVA_OPTIONS (and usually also IBM_JAVA_OPTIONS) to be what you observed in your post:

-Xrunjvmhook -Xbootclasspath/a:C:\PROGRA~1\HP\QUICKT~1\
bin\JAVA_S~1\classes;C:\PROGRA~1\HP\QUICKT~1\bin\JAVA_S~1\classes\jasmine.jar

QTP puts these in place so that it can recognize Java objects, allowing you test a Java application.

It also can create environment variable JAVA_TOOL_OPTIONS with

-agentlib:jvmhook

which is required for working with Java 1.6

If you do not require QTP to perform tests against Java applications then you can experiment with removing these environment variables. Pro-tip for easy reverting, just amend the Environment Variable names (e.g. rename _JAVA_OPTIONS to IGNOREME_JAVA_OPTIONS) *Environment variables require local admin privileges and a system restart to take affect.

If you are using Java version 1.5 or older then you can probably get away with removing JAVA_TOOL_OPTIONS only.

The jasmine.jar seems to be troublesome to a number of java applications; I have had considerable difficulty with this stopping my applications from running in the past.

Upvotes: 5

Ernest Friedman-Hill
Ernest Friedman-Hill

Reputation: 81684

The _JAVA_OPTIONS environment variable is making some very serious modifications to your Java environment -- and obviously doing it wrong, since it's not launching. I don't know what is setting that environment variable, but if it's not something you're trying to do yourself, if I were you I'd make a note of the value just in case you need to restore it, then go to your Windows "System" Control Panel and remove _JAVA_OPTIONS altogether.

Upvotes: 1

Related Questions