Java 1.5, 1.6 and 1.7 along with jnlp

Posted on 2014-08-25
Last Modified: 2014-09-05
Please reference;
The solution, as explained here;  partially worked.  What I did was selected the Java 1.6 at the Java Control Panel and set the Security to its lowest level.  This allowed me to run the application, yet the Java console was/is showing that I am still using Java 1.7.
I need for it to use 1.6_37
Question by:chima
    LVL 77

    Expert Comment

    by:David Johnson, CD, MVP
    Duplicate of a question you said was answered?

    If the application is running properly why do you need it to say 1.6.x?

    Author Comment

    David, it is partially running correctly.  Initially I couldn't even log in.  When I employ these settings I can log in, but when it does a db query it hangs.  A check on the Java Control Panel it shows that it is trying to use Java 1.7 and it should be using Java 1.6_37.
    LVL 77

    Accepted Solution

    create a a batch file that sets the PATH, CLASSPATH, JAVA_HOME to point to the 1.6_37 location to run the application
    set JAVA_HOME= c:\java1.6
    set CLASSPATH= c:\java1.6\classlib
    cd \java1.6
    java java.jar

    Author Comment

    David, I am actually dealing with three applications, each uses a different version of java.  May i request a couple of clarifications;
    My java versions are all at JAVA_HOME= C:\Program Files~(x86)\Java\  here I have the jre and jdk for 1.5_22, 1.6_37 and 1.7_67.
    I can understand using the bat file to set each one when I need each individual version.  Is this what the bat file is intended to do?
     My CLASSPATH is now set to %JAVA_HOME%\jre\lib  I do not see/find the classlib there.
    For cd \java1.6  I would think it would have to be \Program Files (x86)\Java\jre
    And java java.jar is not working.  I get this;
    Exception in thread "main" java.lang.NoClassDefFoundError: java/jar

    Please clarify my comments, thanks
    LVL 26

    Expert Comment

    David Johnson, CD, MVP already gave you a good strategy for solving the problem.  You might need to look at how to run java programs from the command line:

    Basic windows programming tutorials might help too.  If you set an environment variable to be %JAVA_HOME%/jre/lib then all of your programs will use that path.  You have said you want to use 3 different java_home values -- obviously you can't use a single value if you want different ones.

    To execute a java main program from a jar -- as it looks as if you're doing with your "java java.jar" statement? -- then you have to name the main program or use the manifest feature of jars to name your main program.  Again -- just a few tutorials would probably help you.

    Try creating a very simple java program with a main method, put it in a jar, then try your tests.  That will help you figure out the correct environments without having to spend a lot of time getting more complex programs working.

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: Create Mobile App Prototypes with Adobe XD

    This is a project-based course: we go through all the steps of creating a prototype from start to finish, using all the tools and features currently available in Adobe XD. You can complete the course in less than a day, plus all project files and fonts are included.

    Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
    Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
    This Micro Tutorial will go in depth within Systems and Security in Windows 7 and will go into detail regarding Action Center, Windows Firewall, System, etc. This will be demonstrated using Windows 7 operating system.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    737 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

    18 Experts available now in Live!

    Get 1:1 Help Now