Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error message in trying to run java

Tags:

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
like image 585
ibexy Avatar asked Apr 25 '12 21:04

ibexy


1 Answers

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.

like image 160
user2909557 Avatar answered Sep 21 '22 18:09

user2909557