question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

„Unbound classpath container: 'JRE System Library [JavaSE-11]' in project“ With JDK 12 Installed

See original GitHub issue

VS Code reports classpath problems if a Gradle build script specifies source and target versions that are different from the Java version that’s installed:

x Unbound classpath container: 'JRE System Library [JavaSE-11]' in project 'jarexec.plugin'
x The project cannot be built until build path errors are resolved
Environment
  • Operating System: Linux x64 4.15.0-47-generic snap
  • JDK version: OpenJDK 64-Bit Server VM (build 12-ea+15, mixed mode, sharing)
  • Visual Studio Code version: 1.33.1
  • Java extension version: 0.43.0
Steps To Reproduce
  1. Install JDK 12

  2. In the build.gradle file of an existing Gradle project, add the following:

    sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11

  3. Launch VS Code from inside the directory of the existing Gradle project

[attach a sample project reproducing the error] attach logs

Current Result

lingocoder vscode unbound classpath container 0 a

Expected Result

0 Problems. Java does not require there to be an installed version of that specified in the source and target options. Java allows you to specify source and target versions that are lower than that of the installed version of Java that will be used to compile the target code.

Additional Informations

cc: @naco-siren

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:5

github_iconTop GitHub Comments

7reactions
lingocodercommented, Apr 23, 2019

Hey! Thanks @fbricon 👍

F1 | Java: Java Force Compilation | Full did the trick. I also had to do a Java: Clean the Java language server workspace because compilation didn’t seem to take for some reason. Mind you, I am on a super slow, low memory VM at the moment. So that’s gotta be giving vscode some trouble.

Cheers.

3reactions
fbriconcommented, Apr 23, 2019

Oddly enough, this particular setting doesn’t go into ./settings/org.eclipse.jdt.core.prefs but ./settings/org.eclipse.jdt.launching.prefs:

eclipse.preferences.version=1
org.eclipse.jdt.launching.PREF_COMPILER_COMPLIANCE_DOES_NOT_MATCH_JRE=ignore
org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=ignore

You’ll need to execute a full build for the compiler to apply the new settings: (Java force compilation>Full command)

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found