flexiblepower / flexiblepower-build-tools

Shared build tools over all the other repositories. These include shared gradle scripts (for CI) and the bnd tooling.
Apache License 2.0
3 stars 2 forks source link

Java 7 is no longer supported #1

Open YpeKingma opened 6 years ago

YpeKingma commented 6 years ago

On Ubuntu 18.04 I'm following the tutorial here to set up the IDE: https://fan-ci.sensorlab.tno.nl/builds/powermatcher-documentation/master/html/SettingUpTheIDE.html

java -version gives 10.0.1, and the tuturial states that java 1.7 is preferred, and java 8 is not recommended. I ignored that at first, and all steps go as indicated, until it is time to use the bndtools perspective in eclipse. Bndtools turns out not to be present because of: https://github.com/bndtools/bndtools/issues/1819 from which one might conclude that installing bndtools could still work on java 8.

So I tried to downgrade java to 1.7: https://askubuntu.com/questions/819366/how-can-i-select-a-certain-version-of-java but then I ran into this: http://www.webupd8.org/2017/06/why-oracle-java-7-and-6-installers-no.html which states a.o."It's highly recommended you update to Oracle Java 8."

I installed eclipse by downloading and using the installer. I'm using this eclipse version now: Oxygen.3a Release (4.7.3a) Build id: 20180405-1200. Eclipse itself seems to run fine with java 10.

So the question is: shall I try java 8 in spite of the "At the moment we would not recommend using Java 8." in the tutorial?

YpeKingma commented 6 years ago

I retried on another machine, Ubuntu 16.04, with java -version 1.8.0_144, and eclipse version Mars Release (4.5.0), Build id: 20150621-1200.

This went reasonably well, I can run the junit tests in net.powermatcher.test, the result is in the branch dev-j8-20180610 of my fork of the PowerMatcher repo: https://github.com/YpeKingma/powermatcher/tree/dev-j8-20180610

I'm not creating a pull request because I cannot get it to run the net.powermatcher.test.osgi tests. I have tried a few things for that, and the result is in two repo's so I could also change some cached index.xml files between the repos: https://github.com/YpeKingma/powermatcher/tree/dev-j8 https://github.com/YpeKingma/bundle-hub/tree/split-repos-yk

The error message that I'm getting in the eclipse console when trying to run the net.powermatcher.test.osgi tests is:

! Failed to start bundle net.powermatcher.test.osgi-1.0.0.201806111225, exception Unresolved constraint in bundle net.powermatcher.test.osgi [23]: Unable to resolve 23.0: missing requirement [23.0] osgi.wiring.package; (&(osgi.wiring.package=junit.framework)(version>=3.8.0)(!(version>=4.0.0))) org.osgi.framework.BundleException: Unresolved constraint in bundle net.powermatcher.test.osgi [23]: Unable to resolve 23.0: missing requirement [23.0] osgi.wiring.package; (&(osgi.wiring.package=junit.framework)(version>=3.8.0)(!(version>=4.0.0))) at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3980) at org.apache.felix.framework.Felix.startBundle(Felix.java:2043) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:976) at aQute.launcher.Launcher.startBundles(Launcher.java:517) at aQute.launcher.Launcher.activate(Launcher.java:423) at aQute.launcher.Launcher.run(Launcher.java:301) at aQute.launcher.Launcher.main(Launcher.java:147) ! Failed to start bundle biz.aQute.tester-4.0.0.201805111645, exception Unresolved constraint in bundle biz.aQute.tester [24]: Unable to resolve 24.0: missing requirement [24.0] osgi.wiring.package; (&(osgi.wiring.package=junit.framework)(version>=3.8.0)(!(version>=5.0.0))) org.osgi.framework.BundleException: Unresolved constraint in bundle biz.aQute.tester [24]: Unable to resolve 24.0: missing requirement [24.0] osgi.wiring.package; (&(osgi.wiring.package=junit.framework)(version>=3.8.0)(!(version>=5.0.0))) at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3980) at org.apache.felix.framework.Felix.startBundle(Felix.java:2043) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:976) at aQute.launcher.Launcher.startBundles(Launcher.java:517) at aQute.launcher.Launcher.activate(Launcher.java:423) at aQute.launcher.Launcher.run(Launcher.java:301) at aQute.launcher.Launcher.main(Launcher.java:147)

I could not find the root cause for this, it may the 4.0.0 max version test in the error message, it may be a wrong choice of name for a osgi.junit jar, or something else that I have not understood from bndtools.

Any suggestions on how to continue?

YpeKingma commented 6 years ago

As reported here: https://stackoverflow.com/questions/6784463/error-trustanchors-parameter-must-be-non-empty upgrading ubuntu to 18.10 solved the problem that bndtools could not be installed, this was a java bug.

With the update to 18.10, the error message when trying to run the tests from tests.osgi becomes:

Error configuring launch. Object.class [in java.lang [in ]] does not exist

Hopefully I can resolve that, it looks a lot easier than the earlier error message above.