1

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...

Line
  • 1,529
  • 3
  • 18
  • 42

3 Answers3

3

You can provide project specific JDK/JRE by right clicking on project and then select configure properties. There you can update java compiler.

Ruchika Sharma
  • 648
  • 1
  • 7
  • 23
  • What you mean by "configure properties"? – Line Jan 27 '17 at 10:18
  • It means, right click on the project and select the properties option available in the end. Then a popup will appear from where you can select Java compiler and can check what is actually present in your project. – Ruchika Sharma Jan 27 '17 at 10:21
  • OK, i see. But it's weird for me (probably this cause the problem) - I don't have 1.8 there... – Line Jan 27 '17 at 10:22
1

Look in the Preferences in 'Java > Installed JREs > Execution Environments'.

Click on 'JavaSE-1.8' and select the JRE to be used.

greg-449
  • 109,219
  • 232
  • 102
  • 145
  • Thanks. But what to do if I don't have 'JavaSE-1.8' there? – Line Jan 27 '17 at 10:17
  • 2
    As long as you are using recent releases of Eclipse it will be there. If you don't have it your Eclipse release is too old for Java 8. – greg-449 Jan 27 '17 at 10:27
  • It's very weird. We use software which is based on Eclipse Juno. Project is created by colleague which has the same version as me, and still there is Java 1.8 on the project classpath. – Line Jan 27 '17 at 10:30
  • 1
    It is actually possible to add new Execution Environment definitions (see [here](http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-add_new_jre.htm)) maybe your colleague did that. – greg-449 Jan 27 '17 at 11:03
  • Finally, I was wrong. This mate has another version of software. Thanks! – Line Jan 27 '17 at 11:22
0

You can select it on run configuration. Then, click on your run option, and then select JRE overlap.

this example is for eclipse enter image description here

MatWdo
  • 1,610
  • 1
  • 13
  • 26
  • Thanks for screen, but can you explain how I can go there? – Line Jan 27 '17 at 10:25
  • 1
    On top you have run image, and here you can click run configuration. Then choose your application profile and next is on screen – MatWdo Jan 27 '17 at 10:34
  • Whatever I choose, I have warning "Execution environment not compatible with project .class file compatibility: 1.8" :( – Line Jan 27 '17 at 10:40