Re: Environment variables _JAVA_OPTIONS and JAVA_TOOL_OPTIONS is preventing java application to laun (28641 Views)
Reply
Occasional Advisor
abhiagarwal41
Posts: 7
Registered: ‎11-05-2012
Message 1 of 19 (28,671 Views)

Environment variables _JAVA_OPTIONS and JAVA_TOOL_OPTIONS is preventing java application to launch

Hi

 

I have a java application which does not launch on QTP10 - installed machines.

The reason is that QTP sets following environment variables :

 

_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

 

 

IBM_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

 

JAVA_TOOL_OPTIONS -
-agentlib:jvmhook

 

When we remove these variables , the application launches just fine but QTP stops recognizing java objects.

 

Need urgent help on this problem.

 

 

Thanks

Abhishek

HP Expert
vzamoraz
Posts: 502
Registered: ‎04-12-2012
Message 2 of 19 (28,658 Views)

Re: Environment variables _JAVA_OPTIONS and JAVA_TOOL_OPTIONS is preventing java application to laun

Hello,

 

1. Backup your C:\Program Files\HP\QuickTest Professional\bin\java\classes\EventConfiguration.xml
2. Copy the attached EventConfiguration.xml file on same location
3. Try to reproduce the problem; at this point if the problem is related to some java events then the issue should not reproduce
4. If the problem does not occur then you will need to delete one line at a time and then test your application to find out which seems to be causing the problem, try to use notepad to do so, also you can try to delete half chunks of the entries to speed the process of finding out what is the entry we are looking for.
5. Once you have identified what line(s) seem to stop the issue from occurring you will want to have an EventConfiguration.xml with just those lines in it.

 

chnage file attached extension as .xml

 


(Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer.No warranties express or implied for any solution/suggestion posted.)

Occasional Advisor
abhiagarwal41
Posts: 7
Registered: ‎11-05-2012
Message 3 of 19 (28,646 Views)

Re: Environment variables _JAVA_OPTIONS and JAVA_TOOL_OPTIONS is preventing java application to laun

Hi

 

Thanks for the response. But the issue still persists.

Only after removing all the environment variables, the app launches.

And because of this, qtp java add ins does not work.

 

Do suggest if thers anything else i need to do.

 

thanks

Trusted Contributor
MisterT1968
Posts: 107
Registered: ‎04-19-2012
Message 4 of 19 (28,644 Views)

Re: Environment variables _JAVA_OPTIONS and JAVA_TOOL_OPTIONS is preventing java application to laun

Dear Abhishek,

 

How are you? I hope you are fine :)

 

The mentioned Environmental Variables are essential for QuickTest Professional in order to recognize Java applications and Applets. Therefore, removing/renaming them will cause the loss of the ability to test Java as well as Oracle applications.

 

Sometimes it happens, that other Java or Oracle applications may fail to start or may crash at some point. For this the solution in this KnowledgeBase Article may help:

 

http://support.openview.hp.com/selfsolve/document/KM543247 - QuickTest Professional (QTP) configuration crashes (or prevent start/launch of) Java applications (or Oracle)

 

Please check it out and let us know, whether or not it helped. Please also note, that this requires modifications in the registry for which you need to have full Access to it. It is recommended to perform these changes as full Administrator.

 

Best regards,

Tino Pacholski

Functional Testing Support Engineer

[If this post solves or helps solve your issue, mark the thread as solved and give KUDOS to the author for their assistance.]
Occasional Advisor
abhiagarwal41
Posts: 7
Registered: ‎11-05-2012
Message 5 of 19 (28,641 Views)

Re: Environment variables _JAVA_OPTIONS and JAVA_TOOL_OPTIONS is preventing java application to laun

Hi

 

apparently i am unable to access the link. Following shows up :

 

"You are not authorized to view this document"

 

Please help

 

Thanks

Trusted Contributor
MisterT1968
Posts: 107
Registered: ‎04-19-2012
Message 6 of 19 (28,626 Views)

Re: Environment variables _JAVA_OPTIONS and JAVA_TOOL_OPTIONS is preventing java application to laun

Dear Abhiagarwal41,

 

How are you? I hope you are fine :)

 

Can you please register on our support website with the same SAID used for the registration in this forum.

 

Best regards,

Tino Pacholski

Functional Testing Support Engineer

[If this post solves or helps solve your issue, mark the thread as solved and give KUDOS to the author for their assistance.]
Esteemed Contributor
William Schmitt
Posts: 340
Registered: ‎04-02-2008
Message 7 of 19 (28,608 Views)

Re: Environment variables _JAVA_OPTIONS and JAVA_TOOL_OPTIONS is preventing java application to laun

We had this problem with Lotus Notes, which is a java application.  The jvm hooks used by QTP were interfering with Notes.  Removing the jvm hooks allowed Notes to work, but then QTP would not record against java apps.  The solution is to tell QTP to ignore the java application that is being interfered with.  You do this by adding a registry key to [HKEY_LOCAL_MACHINE\SOFTWARE\Mercury Interactive\JavaAgent\Modules].  My entry for Lotus Notes is [HKEY_LOCAL_MACHINE\SOFTWARE\Mercury Interactive\JavaAgent\Modules]
"notes2.exe"=dword:0,  where notes2.exe is the executable for the program that you want QTP to ignore.

 

You can add any java program to the JavaAgent\Modules list in the registry.

Frequent Advisor
aros
Posts: 51
Registered: ‎08-20-2012
Message 8 of 19 (28,599 Views)

Re: Environment variables _JAVA_OPTIONS and JAVA_TOOL_OPTIONS is preventing java application to laun

Hi,

 

Please refer to the following KB article as solution:

 

How to disable QTP java support for specific application

 

http://support.openview.hp.com/selfsolve/document/KM834284

 

Please let me know if is an acceptable solution.

 

Kindly,

 

Aileen

 

Trusted Contributor
MisterT1968
Posts: 107
Registered: ‎04-19-2012
Message 9 of 19 (28,586 Views)

Re: Environment variables _JAVA_OPTIONS and JAVA_TOOL_OPTIONS is preventing java application to laun

[ Edited ]

Hello,

 

How is everybody? :)

 

I am copying the content of the Article I mentioned above, which should be the more convenient solution as it  should limit the changes to 1 and should solve the issue in general ;)

 

Title: QuickTest Professional (QTP) configuration crashes (or prevent start/launch of) Java applications (or Oracle)

Document ID: KM543247

Product: QuickTest Professional,Functional Testing

Version:   Updated: 2012-Jun-01

Summary: Is it possible to limit when the agent for QuickTest Professional is loaded into a Java application? Sometimes users finds that QTP will cause Java based applications to behave unexpectedly, or sometimes even to crash

Problem

 

When both QTP and a Java application is installed on the same machine, some users may find that their Java application may not function correctly or may often crash unexpectedly. This occurs with QTP running but no neccessarily recording.

Cause

 

Collisions with the changes to the Java environment made by QTP's Java or Oracle addin have prevented the applications from launching correctly.

Fix  

 
This will ensure that the Java support is only loaded when QTP and the Java / Oracle addin are loaded
  1. Close QTP and any Java or Oracle related applications.

    Note: steps 2 to 6 are for Web related applications of the Java/Oracle type (mostly Applets)
  2. Navigate to the Java control panel.
  3. Start -> Control panel -> Java control panel
  4. Under the Java Advanced tab navigate to "<APPLET > tab support" (for Java 1.5.x) or "Default Java plugin for browsers" (for Java 1.6.x).

    Note: For Vista or later operating systems, it appears this option may be disabled)
  5. Please uncheck the checkbox "Internet Explorer"
  6. Click "Ok" and continue until Java Control Panel is closed
  7. Navigate to the following registry key:

    HKEY_LOCAL_MACHINE\SOFTWARE\Mercury Interactive\JavaAgent\LoadDependsOnPackage - 32bit Operating System
    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercury Interactive\JavaAgent\LoadDependsOnPackage - 64bit Operating System

  8. Modify the value from “0” to "1". The default value is 0 which indicates that the agent is always loaded into an application. If this value is then changed to 1, it will instruct the agents to only be injected when QTP and the Java addin are loaded.
  9. For changes to take effect, please restart the machine
     
     

Please note, if the entry in the registry does not exist, please create it manually ;)

 

Best regards,

Tino Pacholski

Functional Testing Support Engineer

[If this post solves or helps solve your issue, mark the thread as solved and give KUDOS to the author for their assistance.]
Vlp
Visitor
Vlp
Posts: 2
Registered: ‎12-31-2012
Message 10 of 19 (28,384 Views)

Re: Environment variables _JAVA_OPTIONS and JAVA_TOOL_OPTIONS is preventing java application to laun

On windows 7 64 bit, IE 9, java 1.7 update 10 (32-bit, 64 bit installed),

above solution worked to launch java application when qtp and java app to be launched are on both machines. But when QTP is launched and trying to execute the script which logins to java web application, application does not launch. that is Java control panel (java console ) does not open. Can you suggest more? I see in QTP 11 support Matrix from this link http://www.joecolantonio.com/2011/07/29/qtp-11-support-matrix-with-patch-updates/,

 

QuickTest Professional Java Add-in -> Java Runtime Engines->Sun JDK->1.7->Support information is 'No'

 

QuickTest Professional Java Add-in -> Java Runtime Engines->Sun Java Web Start->1.6.x->Support information is 'Yes' (here 1.7 is not mentioned)

 

 Do I need to download any other patches to lauch the java application via QTP script? Also we would run the QTP script from QC.

 

 

Occasional Visitor
RalfB
Posts: 2
Registered: ‎04-30-2012
Message 11 of 19 (26,621 Views)

Re: Environment variables _JAVA_OPTIONS and JAVA_TOOL_OPTIONS is preventing java application to laun

[ Edited ]

 

QTP10/Java 1.6.0_33 (6.3)

 

There is another issue with QTP Java addin, that prevents Java from creating the shared achive file "classes.jsa". This file is used since version 5 to short the startup time and can be created with command:

C:\Program Files\Java\jre6\bin>java -Xshare:dump

 

When QTP is installed, this operation fails with following messages:

Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
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
Loading classes to share ... done.
Rewriting and unlinking classes ... done.
Calculating hash values for String objects .. done.
Calculating fingerprints ... done.
Removing unshareable information ... done.
Moving pre-ordered read-only objects to shared space at 0x38020000 ... done.
Moving read-only objects to shared space at 0x383c44e8 ... done.
Moving common symbols to shared space at 0x383c5f80 ... done.
Moving remaining symbols to shared space at 0x38474c30 ... done.
Moving string char arrays to shared space at 0x38475dc0 ... done.
Moving additional symbols to shared space at 0x384f81f0 ... done.
Read-only space ends at 0x3854d180, 5427584 bytes.
Moving pre-ordered read-write objects to shared space at 0x38a20000 ... done.
Moving read-write objects to shared space at 0x390400b0 ... done.
Moving String objects to shared space at 0x3907bbe0 ... done.
Read-write space ends at 0x390b8120, 6914336 bytes.
Updating references to shared objects ... done.

An error has occurred while processing the shared archive file.
Boot classpath directory C:\PROGRA~1\HP\QUICKT~1\bin\JAVA_S~1\classes is not empty.
Error occurred during initialization of VM
Unable to use shared archive.

 

Reason:

The JAVA source code tells, that any entry of the JAVA environment variable "Xbootclasspath" must be either a JAR file or an empty directory.

 

Unfortunately the QTP environment entry contains an non-empty directory "..bin\JAVA_SHARED\\classes":

_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

 

When I insert each file name in the directory C:\PROGRA~1\HP\QUICKT~1\bin\JAVA_S~1\classes separately to the Xbootclasspath command, the shared archive can be created, but the QTP Java Addin support doesn't work no more (no object recognition).

 

Occasional Visitor
Jaspreet_QTP
Posts: 3
Registered: ‎07-22-2013
Message 12 of 19 (23,189 Views)

Re: Environment variables _JAVA_OPTIONS and JAVA_TOOL_OPTIONS is preventing java application to laun

I am facing the same issue do you have solution for above

Occasional Visitor
Jaspreet_QTP
Posts: 3
Registered: ‎07-22-2013
Message 13 of 19 (23,188 Views)

Re: Environment variables _JAVA_OPTIONS and JAVA_TOOL_OPTIONS is preventing java application to laun

After doing the steps you have mentioned (changes to enmvironment configuration.xml file). Now i am not able to launch application

Occasional Visitor
VaibhavLolge
Posts: 1
Registered: ‎09-25-2013
Message 14 of 19 (20,992 Views)

Re: Environment variables _JAVA_OPTIONS and JAVA_TOOL_OPTIONS is preventing java application to laun

Hi,

This is for a workaround where you DO NOT need to run java application and QTP at the same time.

If you need to, please do not read the following and waste your time :)

 

I recently started using a Windows 7 and had to install QTP there.

Due to this installation, my Java applications failed to start.

Even simple executable jar files would not start. As everyone above said, I checked the env variable and yes, JAVA_TOOL_OPTIONS was the culprit.

 

The reason why I am posting this is, I have a different situation where I am not the system admin and cannot access HKEY.  Neither can I change the already existing System Varialble.

 

Solution:

I create a variable JAVA_TOOL_OPTIONS  for my user account and assigned the value <space> to this variable and the Java application started working!!

 

Now, when I need to start QTP, I only need to delete the varialble for my account and we have QTP.

 

I know this is a dirty solution for the problem but as long as my application is working, I am happy! :)

 

Hope this helps someone.

 

 

Occasional Contributor
Dougal1709
Posts: 5
Registered: ‎03-05-2013
Message 15 of 19 (19,376 Views)

Re: Environment variables _JAVA_OPTIONS and JAVA_TOOL_OPTIONS is preventing java application to laun

The other alternative is to create a batch file for the Java app where you default the java environment variables to nothing, ie.

 

SET IBM_JAVA_OPTIONS=
SET _JAVA_OPTIONS=
SET JAVA_TOOL_OPTIONS=

C:\JavaApp.exe

Occasional Contributor
coolShaily
Posts: 6
Registered: ‎08-03-2010
Message 16 of 19 (17,503 Views)

Re: Environment variables _JAVA_OPTIONS and JAVA_TOOL_OPTIONS is preventing java application to laun

Hi All,

 

I was facing same issue and got resolved after installing the QTP patch for Oracle support  :)

 

 

 

Patch name: QTPORACLE_00010

 

Now I am able to open Oracle forms properly before and after opening QTP.

 

Thanks,

Priyank

 

Occasional Visitor
RachnaBahl
Posts: 2
Registered: ‎02-20-2014
Message 17 of 19 (14,689 Views)

Re: Environment variables _JAVA_OPTIONS and JAVA_TOOL_OPTIONS is preventing java application to laun

I had the UFT11.5 +Burp Tool installed on my machine. i was shocked to see after installation of UFT,Burp.jar file was not running.Then i reset all below value  set to blank means <space>.This is the Best Answer.This Really Works:

 

_JAVA_OPTIONS= <space>

JAVA_TOOL_OPTIONS= <space>

IBM_JAVA_OPTIONS =<space>

Occasional Visitor
RachnaBahl
Posts: 2
Registered: ‎02-20-2014
Message 18 of 19 (14,687 Views)

Re: Environment variables _JAVA_OPTIONS and JAVA_TOOL_OPTIONS is preventing java application to laun

Thank you very-very much.This really helped me a lot:-)

Occasional Visitor
mengistu
Posts: 2
Registered: ‎03-19-2014
Message 19 of 19 (13,371 Views)

Re: Environment variables _JAVA_OPTIONS and JAVA_TOOL_OPTIONS is preventing java application to laun

Unable to launch Oracle EBS forms that uses JRE 1.7 after installing QTP 11.0.

 

I am working on Oracle EBS application that uses java application JRE 1.7 which does not launch after installing QTP 11.0. I am getting the below error when I try to open EBS forms.

 

Exception: java.lang.RuntimeException: java.lang.ClassFormatError: Illegal exception table range in class file oracle/forms/engine/Runform Loading HP QuickTest Professional Java Support (version 11.0.0.0) (SUN 1.6.0_20)

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.