Two Java versions on a win 7 machine

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?
LVL 6
Sid_FAsked:
Who is Participating?
 
Sid_FConnect With a Mentor Author Commented:
The solution is to install java with command line static =1 this stops it from being overwritten by a newer version
0
 
CEHJCommented:
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
 
dpearsonCommented:
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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
CEHJCommented:
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
 
Sid_FAuthor Commented:
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
 
CEHJCommented:
At the moment it cannot run on anything higher than 6u25.
Why? How have they managed to make that (im)possible?
0
 
dpearsonCommented:
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
 
Sid_FAuthor Commented:
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
 
CEHJCommented:
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
 
Sid_FAuthor Commented:
Where do I find the jnlp file?
0
 
CEHJCommented:
There should be a reference to it in the page from which you load it
0
 
Sid_FAuthor Commented:
A reference where?
0
 
CEHJCommented:
In the page source. Search it
0
 
Sid_FAuthor Commented:
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
 
CEHJCommented:
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
 
Sid_FAuthor Commented:
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
 
CEHJCommented:
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
 
Sid_FAuthor Commented:
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
 
CEHJCommented:
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
 
Sid_FAuthor Commented:
Resolved
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.