3

In eclipse, ./gradlew is generating JavaSE-1.8 instead of using my jdk1.8.0_73. What jdk is this because I discovered lately that it seems like it is 'not' my jdk1.8.073 for the following reason.....

I installed alpn.jar from jetty in jre/classes (I unzipped the classes there since the sun.boot.class.path says that directory is in the bootclasspath AND then I don't have add -Xbootclasspath to every tool in the world on my computer).

When I ./gradlew eclipse, my projects using this jar break and then when I remove JavaSE-1.8, and then re-add jdk1.8.0_73, all is fine and it compiles in eclipse and intellisense works and everything.

Soooooo, what is JavaSE-8 and how to remove it so when ./gradlew eclipse runs, it uses whatever default my eclipse is pointing to which in my case is jdk1.8.0_73.

One last question, why is JavaSE-1.8 not even listed on Installed JREs?

This is all quite confusing.

Dean Hiller
  • 19,235
  • 25
  • 129
  • 212
  • 1
    Sounds like you have another Java 8 on your box. If you're using cygwin or on a Linux box type 'which java' and see where it points. – Dale May 16 '16 at 00:36
  • 'where java' works on Windows – bakoyaro May 16 '16 at 01:11
  • 'which java' yielded /usr/bin/java and java -version points to my exact version 1.8.0_73. when I ls -la /usr/bin/java, I get /System/Library/Frameworks/JavaVM.framework/Versions/Current and I can only assume that points to my version...there are only two versions I can find on the machine...mine and a 1.7. I am not sure how to see where the java in JavaVM.framework/Versions/Current directory is using though for sure as it is not a link. – Dean Hiller May 16 '16 at 13:49

1 Answers1

1

If you know there to find the "Installed JREs" in the Eclipse Preferences, just expand the "Installed JREs" node and select "Execution Environments", and things should become clear.

See https://wiki.eclipse.org/Execution_Environments for details of what they are.

Execution environments (EEs) are symbolic representations of JREs. For example, rather than talking about a specific JRE, with a specific name at a specific location on your disk, you can talk about the J2SE-1.4 execution environment. The system can then be configured to use a specific JRE to implement that execution environment.

Obviously that text was written some time ago, but your JavaSE-1.8 execution environment should automatically map to a Java 8 installed JRE. If you have more than one Java 8 installed JRE, you can choose which you prefer.

Andreas
  • 154,647
  • 11
  • 152
  • 247
  • ok, so things get yet weirder then. When I select JavaSE-1.8 under execution environments, there is only one compatible JRE(mine) and that is 'not' selected so what is it using then? This is so weird. – Dean Hiller May 16 '16 at 13:45
  • Read the text above the list. It *is* using it. The checkbox is there for you to use if there is more than one perfect match. – Andreas May 16 '16 at 13:47