Solved

Two Java versions on a win 7 machine

Posted on 2014-03-20
20
447 Views
Last Modified: 2014-04-18
I need to run a browser based application that uses java 6 update 25 at the same time the machine needs to run the latest version for other applications. Is there any way for the two to co-exist and work without user interaction?
0
Comment
Question by:Sid_F
  • 9
  • 9
  • 2
20 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 39942645
I need to run a browser based application that uses java 6 update 25
Why? Did someone manage to write an app that will only run on one specific (even down to the minor) version or something? If so, how have they managed to do that?
0
 
LVL 26

Expert Comment

by:dpearson
ID: 39943228
As to how to set this up - you can install two versions of Java alongside each other with no problem.

The trick is which Java is then used by a given application.  That would mean setting the PATH and JAVA_HOME environment variables to the appropriate Java installation that you wished to use for each application.

That can usually be done by having a batch file for a given app, that sets these values and then launches the app.  If you then launch through the batch file, that lets you set up different environment variables just for that specific instance of the app - and hence different from other applications on the system.

Does that all make sense?

Doug

P.S. To answer CEHJ's question about how could this happen - I remember running into this when 64-bit Java started to appear.  A few legacy apps only supported the 32-bit version (good question as to how they managed to do that, but they did - presumably they had some native code calls) and so I had to use this trick to run 64-bit everywhere except for those specific apps.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39943805
You should really ask the vendor  the same questions. Java is just about the foremost malware vector. This will give you a flavour of why you should not have any out of date Java on your system

http://www.cvedetails.com/vulnerability-list/vendor_id-5/product_id-1526/cvssscoremin-6/cvssscoremax-6.99/SUN-JRE.html
0
 
LVL 5

Author Comment

by:Sid_F
ID: 39944647
At the moment it cannot run on anything higher than 6u25. It's an old application and will be updated later in the year but right now I have to get a work around.
The two versions seems like a good option but can you give me some detail as to the batch file and what needs to go in it.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39944847
At the moment it cannot run on anything higher than 6u25.
Why? How have they managed to make that (im)possible?
0
 
LVL 26

Expert Comment

by:dpearson
ID: 39946011
The two versions seems like a good option but can you give me some detail as to the batch file and what needs to go in it.

It should look something like this:

set JAVA_HOME=c:\java\jdk32_1.6.0_45
set PATH=c:\java\jdk32_1.6.0_45;%PATH%
java -jar c:\myoldprogram\bin\myoldprogram.jar

Doug
0
 
LVL 5

Author Comment

by:Sid_F
ID: 39955922
I'm not sure I follow as my old app does not have a jar file. I might be missing something so will give further details.

my old app is lets say https://oldserver
The location of the two java versions are
C:\Program Files\Java\jre6
C:\Program Files\Java\jre7

What do I need to do in order to get this to work.
Thanks
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39956047
If the it's browser-based and an app, it follows that there must be a jnlp file from which it's loaded. Can you post that jnlp file (edited if necessary) to be anonymous?
0
 
LVL 5

Author Comment

by:Sid_F
ID: 39956151
Where do I find the jnlp file?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39956259
There should be a reference to it in the page from which you load it
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 5

Author Comment

by:Sid_F
ID: 39956420
A reference where?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39956456
In the page source. Search it
0
 
LVL 5

Author Comment

by:Sid_F
ID: 39961002
Ok got it
<HTML>
<!-- FILE: basejpi.htm (Oracle Forms)                                 -->
<!--                                                                  -->  
<!-- This is the default base HTML file for running a form on the     -->
<!-- web using the JDK Java Plugin. This is used for example when     -->
<!-- running with Netscape on Unix.                                   -->
<!--                                                                  -->  
<!-- IMPORTANT NOTES:                                                 -->
<!-- Default values for all the variables which appear below          -->
<!-- (enclosed in percent characters) are defined in the servlet      -->
<!-- configuration file (formsweb.cfg). It is preferable to make      -->
<!-- changes in that file where possible, rather than this one.       -->
<!--                                                                  -->  
<!-- This file will be REPLACED if you reinstall Oracle Forms, so     -->
<!-- you are advised to create your own version if you want to make   -->
<!-- any modifications.  You should then set the baseHTMLjpi          -->
<!-- parameter in the Forms Servlet configuration file (formsweb.cfg) -->
<!-- to point to your new file instead of this one.                   -->
<HEAD><TITLE>Oracle Application Server Forms Services</TITLE></HEAD>
<BODY >

<COMMENT id="forms_plugin_info"
         plug_ver="clsid:CAFEEFAC-0016-0000-FFFF-ABCDEFFEDCBA"
         appheight="100%"
         appwidth="100%"
         appcodebase="https://java.sun.com/update/1.6.0/jinstall-6u12-windows-i586.cab#Version=1,6,0,12">
</COMMENT>
<!-- Forms applet definition (start) -->
<NOSCRIPT>
<OBJECT classid="clsid:CAFEEFAC-0016-0000-FFFF-ABCDEFFEDCBA"
        codebase="https://java.sun.com/update/1.6.0/jinstall-6u12-windows-i586.cab#Version=1,6,0,12"
        WIDTH="100%"
        HEIGHT="100%"
        HSPACE="0"
        VSPACE="0">
</NOSCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="java/forms_ie.js"></SCRIPT>
<PARAM NAME="TYPE"       VALUE="application/x-java-applet;jpi-version=1.6.0_12">
<PARAM NAME="CODEBASE"   VALUE="/forms/java">
<PARAM NAME="CODE"       VALUE="oracle.forms.engine.Main" >
<PARAM NAME="ARCHIVE"    VALUE="jacob.jar,images.jar,frmwebutil.jar,frmall.jar" >
<PARAM NAME="serverURL" VALUE="/forms/lservlet?ifcfs=/forms/frmservlet?config=live&acceptLanguage=en-IE">
<PARAM NAME="networkRetries" VALUE="30">
<PARAM NAME="serverArgs"
       VALUE="escapeParams=true module=hr0000.fmx userid=  sso_userid=%20 sso_formsid=formsApp_myserver.mydomain.local_57994C018CBF11DEBF6C23D57D461B2 sso_subDN= sso_usrDN= debug=no host= port= buffer_records=no debug_messages=no array=no obr=no query_only=no quiet=yes render=no record= tracegroup= log= term=">
<PARAM NAME="separateFrame" VALUE="true">
<PARAM NAME="splashScreen"  VALUE="no">
<PARAM NAME="background"  VALUE="no">
<PARAM NAME="lookAndFeel"  VALUE="oracle">
<PARAM NAME="colorScheme"  VALUE="blue">
<PARAM NAME="serverApp" VALUE="default">
<PARAM NAME="logo" VALUE="no">
<PARAM NAME="imageBase" VALUE="codebase">
<PARAM NAME="formsMessageListener" VALUE="">
<PARAM NAME="recordFileName" VALUE="">
<PARAM NAME="EndUserMonitoringEnabled" VALUE="">
<PARAM NAME="EndUserMonitoringURL" VALUE="">
<PARAM NAME="heartBeat" VALUE="">
<PARAM NAME="allowAlertClipboard" VALUE="">
<PARAM NAME="disableValidateClipboard" VALUE="">
<PARAM NAME="enableJavascriptEvent" VALUE="">
<PARAM NAME="MAYSCRIPT" VALUE="">
<PARAM NAME="digitSubstitution" VALUE="">
<COMMENT>
<EMBED SRC="" PLUGINSPAGE="https://myserver/forms/jinitiator/jre-6u12-windows-i586-p.exe"
        TYPE="application/x-java-applet;jpi-version=1.6.0_12"
        java_codebase="/forms/java"
        java_code="oracle.forms.engine.Main"
        java_archive="jacob.jar,images.jar,frmwebutil.jar,frmall.jar"
        WIDTH="100%"
        HEIGHT="100%"
        HSPACE="0"
        VSPACE="0"
        serverURL="/forms/lservlet?ifcfs=/forms/frmservlet?config=live&acceptLanguage=en-IE"
        networkRetries="30"
        serverArgs="escapeParams=true module=hr0000.fmx userid=  sso_userid=%20 sso_formsid=formsApp_myserver.mydomain.local_57994C018CBF11DEBF6C23D57FD461B2 sso_subDN= sso_usrDN= debug=no host= port= buffer_records=no debug_messages=no array=no obr=no query_only=no quiet=yes render=no record= tracegroup= log= term="
        separateFrame="true"
        splashScreen="no"
        background="no"
        lookAndFeel="oracle"
        colorScheme="blue"
        serverApp="default"
        logo="no"
        imageBase="codebase"
        recordFileName=""
        EndUserMonitoringEnabled=""
        EndUserMonitoringURL=""
        heartBeat=""
        disableValidateClipboard=""
        allowAlertClipboard=""
        enableJavascriptEvent=""
        MAYSCRIPT=""
        digitSubstitution=""
>
<NOEMBED>
</COMMENT>
</NOEMBED></EMBED>
</OBJECT>
<!-- Forms applet definition (end) -->

</BODY>
</HTML>
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39961088
As you can see, that source specifies the version it wants. Personally i would try to change that version to the latest jre for the reasons given earlier, though exactly the way to do this i don't know, as i don't do Oracle Forms.

I would guess the were you to install an additional jre, say the latest, there might not be any problem. Why do you think there would be?
0
 
LVL 5

Author Comment

by:Sid_F
ID: 39965931
The software cannot run on anything other than version 6. It will not display correctly. I cannot start to change oracle forms I must work with what I have. My question still stands as I believe there might be a way to do this via a batch file flipping from the old to the new version when required.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39966047
If you don't want to change the JRE version in the code you just posted, then just change it for the application/applets(s) you want to use the latest JRE. If you don't, you'll probably find it/they will just use the same as the current

See http://www.oracle.com/technetwork/java/javase/autodownload-140472.html
Note that (probably deliberately) nothing other than the latest version is provided for auto-installation (your current configuration supporting auto-installation)
0
 
LVL 5

Author Comment

by:Sid_F
ID: 39966334
I am not clear on what you mean but maybe I can recap from my further tests.

If I install java version 6, my old applications runs no problem. If I install the latest java 7 the application is unable to run. Even if I go into the java config and untick V7 and tick V6 the application is still unable to run. I have to uninstall V7 and then it works again

I want to be able to run the two versions together.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39966404
Perhaps you haven't taken this on board yet - the code you posted constrains the app to use a specific version (6). This might or might not be a reflection of restrictions inherent in the app
0
 
LVL 5

Accepted Solution

by:
Sid_F earned 0 total points
ID: 39998472
The solution is to install java with command line static =1 this stops it from being overwritten by a newer version
0
 
LVL 5

Author Closing Comment

by:Sid_F
ID: 40008410
Resolved
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
The viewer will learn how to implement Singleton Design Pattern in Java.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now