JohnDoe
JohnDoe

Reputation: 235

Compile Java Program in Eclipse with Older JRE Without Installing

I want my program to work for people with older versions of Java. My program doesn't need any special new features and it should be able to run fine in Java 6. I have Java 8 installed, and I want to know how I would go about compiling my program in Eclipse in an older version of Java without having to install Java 6.

Upvotes: 4

Views: 11542

Answers (2)

John Black
John Black

Reputation: 1

Another thing to consider is checking to see if your JRE matches the compiler version you are using in Eclipse. You'll have to download the JRE needed.

Upvotes: 0

EDToaster
EDToaster

Reputation: 3180

  • In the Project Explorer view, right-click on the project and then select Properties.
  • Select the Java Compiler page in the in the Properties window.
  • In the JDK Compliance section, select the desired Compiler compliance level.
  • Click Apply and then Ok.

It will automatically compile to the right version

Note this doesn't actually change the version, just that the compiler would be able to enforce the rules that another Java version would. So it should be compatible

For cross verfiying if it is compiled properly with the lower version, 1. Go to properties 2. go to java build path 3. go to libraries, 4. click on JRE System Library-- double click this to see if exceution environment is properly set.

Upvotes: 12

Related Questions