简体   繁体   中英

How do I check that my Java application will run on a machine with JRE 1.6/1.7?

I have a few applications that I am giving to my colleagues on customer support. I made all of these applications using JRE 1.8, and most of the machines that are being used are using a JRE of 1.6 or 1.7. I have refactored the code so that it will work with these versions of Java.

However, how am I supposed to test that these applications will in fact run on a machine with these versions of Java installed? Do I have to use another computer? Is there any way of testing this from my own PC?

I'm using launch4j to create an .exe file that will run the application (they're just tools to help some troubleshooting processes)

Just to try be more clear, I have the latest version of Java installed on my PC, and I want to test that PCs with Java 1.6/1.7 will still run the .exe file generated from launch4j; so how do I do this on my own PC?

In your IDE (for example eclipse) you can change the project properties for the java compiler "Compiler compliance level" from 1.8 to 1.6. Then build the new code. (By the way, if you like to support Java 1.6 you should only compile with this compliance level)

If you have still installed old Java-JRE-Versions on your PC you can set JAVA_HOME environment to the JRE 1.6 folder (Checks %PATH% too and rename your java 8 JDE and java 8 JRE folder temporaerly for safety).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM