How can I change JRE version in Eclipse project? - java

Hello I have an project in Eclipse and I need change my JRE version in this progect to JRE 1.7 from JRE 1.8.
How can I do it?

In the Preferences go to 'Java > Installed JREs' and add the Java 8 JRE/JDK if it is not already there.
In the Properties for the project look at 'Java Build Path'. On the 'Libraries' tab edit the JRE entry and select Java 8.
You may also want to set the Java Compiler preferences for the project (or the global preferences) to specify Java 8 compliance.
Note: You need to be running Eclipse Luna (4.4) or later for full Java 8 support.

Windows > Preferences > Java > Installed JREs

Related

Unbound classpath container : 'JRE System Library in project 'HelloWorld'

I just installed Eclipse + Java and trying to make my first HelloWorld project.
But I have this error message after creating the project.
I have read the many posts but it does not help me, because I do not even have a JRE installed in my Eclipse,
See my screenshot.
What can I do?
Where to find the JRE?
I have already installed the JDK.
Thanks
I notice you haven't installed any JRE - which is probably your problem.
Download the version (example here 1.8) from Oracle.
Then on Eclipse, try:
Window -> Preferences -> Java -> Installed JREs -> Add
And follow the guide to your previously installed JRE.
Then go to:
Window -> Preferences -> Java -> Compiler -> Compiler compliance level
Ensure that matches the installed JDK.
In your screenshot click the Add... button
Select Standard VM and click Next >
Enter the installation directory of your Java 8 JRE (or better JDK) and click Finish

how to set specific system JRE due to Eclipse project?

I imported Java project from SVN and want to run it without changing the classpath. I installed JDK 8 (java -version shows
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
), but on the project I see error:
Unbound classpath container: 'JRE System Library [JavaSE-1.8]' in project
I also added "Standard VM" in Window -> Preferences -> Java -> Installer JREs, but it didn't help.
I guess I have to set my system JRE exactly to JRE which is set in the project. But as far as I understand, it's the save version...
You can provide project specific JDK/JRE by right clicking on project and then select configure properties. There you can update java compiler.
Look in the Preferences in 'Java > Installed JREs > Execution Environments'.
Click on 'JavaSE-1.8' and select the JRE to be used.
You can select it on run configuration. Then, click on your run option, and then select JRE overlap.
this example is for eclipse

Updating JDK in Eclipse

I have been having problems with appcompat_v7, someone told me to use Android-21 target. An error with that got me told to use JDK 1.8. I currently have JDK 1.6 installed. How do I switch Eclipse over to use JDK 1.8? I see no place to set the JDK path. The other time this question was asked, the questioner was referred to the JRE settings ... but the JDK is not the JRE, there are two separate paths. How do I get Eclipse to use the new JDK?
Project Menu > Properties menu item > Java Compiler > Compiler Compliance Level
Select your Java version from the pulldown menu. Obviously, you'll need to install Java 1.8 first to get it to show up as an installed version.

JRE version is 1.6.0; version 1.7.0 or later is needed to run Google Plugin for Eclipse

I have 3 versions of Java installed on my system: 6, 7, and 8... I am required to have JRE6 available for a product my company develops, so I cannot get rid of it... But despite copying my Eclipse install to a new folder for another project I need to work on and removing JRE6 from this version alltogether, I still cannot get it to work.
How can I get the google plugin for Eclipse to work in my scenario?
If you have created a shortcut to start eclipse, you can add a parameter to tell it to use the jre of your choice like this -
C:\eclipse\eclipse.exe -vm "C:\Programs\jdk\jdk1.7.0_55\bin\javaw.exe"
I have used "javaw" executable from a jdk installation, but you may point to the same executable within a JRE installation as well.
This will resolve the error.
Keep in mind that there is a separation between the JVM that Eclipse itself is running in and the various JREs that you can configure in Eclipse to run your programs/applications. You need to specify to Eclipse what JVM you want it to run under, using eclipse.ini.
That's separate from the Installed JREs configuration you show in your screen shot above.
Add Java 7.0 to Eclipse if you haven't: Window -> Preferences -> Java -> Installed JREs.
Next add Java 7.0 library to your project: Right click on project -> Properties -> Java Build Path -> Libraries tab -> Remove JRE 1.6 and add New Library (JRE System Library, 1.7.0).
Last set Java 7.0 compliance level: Right click on project -> Preferences -> Java Compiler -> Compiler compliance level: 1.7
Also since you can use different Java to run applications, you also have to change this in the Run configuration which you use to start AppEngine related tasks.

java build path problems [duplicate]

This question already has answers here:
Warning - Build path specifies execution environment J2SE-1.4
(12 answers)
Closed 6 years ago.
From someone's project, I am getting this error:
Java Build Path Problems (1 item)
Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workplace that are strictly compatible with this environment.
I have the latest JDK (jdk1.6.0_25). From my understanding, I can do one of the following:
Download the J2SE-1.5 environment to match the project.
Edit the project to agree with the latest JDK. How can I do this?
Right click on project, Properties, Java Build Path.
Remove the current JRE library.
Click Add library > JRE System Library > Workspace default JRE.
Here's a good discussion on this:
How to use JDK 1.6 in 1.5 compliance mode
Basically you should
Download and install the 1.5 JDK. (download link)
In Eclipse, Go to Window → Preferences → Java → Installed JREs.
Add the 1.5 JDK to the list.
Select 1.5 as Compiler Compliance Level.
Go for the second option, Edit the project to agree with the latest JDK
Right click "JRE System Library [J2SE 1.5] in your project"
Choose "Properties"
Select "Workspace default JRE (jdk1.6)
From the Package Explorer in Eclipse, you can right click the project, choose Build Path, Configure Build Path to get the build path dialog. From there you can remove the JRE reference for the 1.5 JRE and 'Add Library' to add a reference to your installed JRE.
To configure your JRE in eclipse:
Window > Preferences > Java > Installed JREs...
Click Add
Find the directory of your JDK > Click OK
Try this too in addition to MahmoudS comments.
Change the maven compiler source and target in your pom.xml to the java version which you are using. Say 1.7 for jdk7
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>

Categories