Java 1.5, 1.6 and 1.7 along with jnlp

Posted on 2014-08-25
Medium Priority
Last Modified: 2014-09-05
Please reference; http://www.experts-exchange.com/Programming/Languages/Java/Q_28495151.html
The solution, as explained here; http://stackoverflow.com/questions/21404830/securityexception-during-executing-jnlp-file-missing-required-permissions-manif  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
  • 3
  • 2
LVL 85

Expert Comment

by:David Johnson, CD, MVP
ID: 40285253
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

ID: 40286810
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 85

Accepted Solution

David Johnson, CD, MVP earned 2000 total points
ID: 40286892
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 40289268
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 27

Expert Comment

ID: 40290727
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

ID: 40306827

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Make the most of your online learning experience.
Don’ts and Dos are two important end products of software testing basics that a tester needs to regard. This article attempts to explain the principles of both.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

609 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