|Unbound classpath container: JRE System Library (in test, OS X, tycho) [message #1817520]
||Mon, 25 November 2019 10:01
| Alex Mising name
Registered: March 2010
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.
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
Powered by FUDForum
. Page generated in 0.02135 seconds