Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Unbound classpath container: JRE System Library (in test, OS X, tycho)
Unbound classpath container: JRE System Library (in test, OS X, tycho) [message #1817520] Mon, 25 November 2019 10:01 Go to next message
Alex Mising name is currently offline Alex Mising nameFriend
Messages: 149
Registered: March 2010
Senior Member
Hello,

This is a bit of a weird problem: when I run "mvn verify" on an OS X system, one of my plugin tests fails because the workspace created cannot locate the JDK.

The test is a slightly complicated integration test, but the problem is quite simple: the JDT project created in the test workspace cannot resolve the JRE libraries and when I build my "test project" in the "test workspace" I have an assertion that verifies there are no problem markers, only there's 2 of them: one that says the classpath container for the JavaSE-1.8 execution environment is unbound and the other saying that the "test project" cannot be built until the callpath issue is resolved.

This happens only when building with maven and only on OS X. If I run the test from within the Eclipse workspace on OS X everything works fine. It is only when I run "mvn verify" where tycho-surefire-plugin kicks in that the problem arises. Furthermore on Windows 10 I can run "mvn verify" just fine.

I've made sure my JAVA_HOME is pointing to the correct location using /usr/libexec/java_home (I have Oracle JDK 8 Update 231 on that laptop). It's really weird because maven itself uses that JDK compiler (if you run maven with a JRE it would fail saying it needs a JDK) so I know that the configuration is ok (the JDK is first in the PATH and the JAVA_HOME points to it).

I'm actually a bit lost with regard to what to check. Any suggestions on whatever you think I could investigate are welcome.

Quote:
UPDATE: I've added a "TimeUnite.MINUTES.sleep(2)" statement in the beginning of the first unit test. This allows me to interact with the instance that pops up, as it waits for the unit test thread to proceed. I try to create a new Java Project manually and see in the first page of the dialog the warning "The default JRE could be detacted. To add a JRE manually go to the JREs preference page". Clicking on the link and adding the JRE at "/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home" fixes the test workspace, so when the 2-minute time out elapses the test proceeds and completes successfuly. So indeed it is a case of the JRE not being detected...

[Updated on: Mon, 25 November 2019 15:14]

Report message to a moderator

Re: Unbound classpath container: JRE System Library (in test, OS X, tycho) [message #1817540 is a reply to message #1817520] Mon, 25 November 2019 15:19 Go to previous messageGo to next message
Alex Mising name is currently offline Alex Mising nameFriend
Messages: 149
Registered: March 2010
Senior Member
According to the FAQ Find the JVM entry, Eclipse ignores JAVA_HOME and uses "eclipse.ini" and the system path to identify the JRE. I've made sure to put "/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin" as the first entry in PATH but still the JRE is not detected.
Re: Unbound classpath container: JRE System Library (in test, OS X, tycho) [message #1817565 is a reply to message #1817540] Mon, 25 November 2019 23:27 Go to previous messageGo to next message
Alex Mising name is currently offline Alex Mising nameFriend
Messages: 149
Registered: March 2010
Senior Member
It appears that the VM installation code explicitly ignores Mac OS X installations as can be seen in StandardVMType.detectInstallLocation().

It seems to me that macosx-specific feature fragments may be missing when I run the integration tests. Will be looking into that next...
Re: Unbound classpath container: JRE System Library (in test, OS X, tycho) [message #1817566 is a reply to message #1817565] Mon, 25 November 2019 23:43 Go to previous message
Alex Mising name is currently offline Alex Mising nameFriend
Messages: 149
Registered: March 2010
Senior Member
Adding an explicit dependency on "org.eclipse.jdt.launching.macosx" resolves this!
Previous Topic:[Solved] Message "Error creating Groovy: java.lang.ClassNotFoundException" when using JDT'
Next Topic:Problem about plugin supports search feature In eclipse
Goto Forum:
  


Current Time: Thu Mar 28 21:29:02 GMT 2024

Powered by FUDForum. Page generated in 0.03018 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top