Skip to content
This repository has been archived by the owner on Apr 3, 2018. It is now read-only.

could not start goclipse because java version is 0 #256

Open
haoquanwang opened this issue Nov 23, 2017 · 5 comments
Open

could not start goclipse because java version is 0 #256

haoquanwang opened this issue Nov 23, 2017 · 5 comments

Comments

@haoquanwang
Copy link

goclipse version: 0.16.1
Eclipse Version: Oxygen.1a Release (4.7.1a) Build id: 20171005-1200
java version "9.0.1"
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

When there is JDK 9 installed, starting Eclipse would give an error message "could not start goclipse because java version is 0"

I also installed JRE 9, problem remains the same.

Work around would be: installing JDK 8 along side java 9, then either:

1: Add -vm/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin/java to /Applications/Eclipse.app/Contents/Info.plist

Or:

2: change -vm option in /Applications/Eclipse.app/Contents/Eclipse/eclipse.ini from

-vm
/Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home/bin
-vmargs

to

-vm
/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin
-vmargs

I suppose substitute "jdk1.8.0_152.jdk" to any subversion of java 1.8 on your mac OS would work but I haven't tried. jdk1.8.0_152 is the latest as of 23rd November 2017.

I notice there is jre in /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/ but there is no jre in /Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home even I have installed jre 9.

@haoquanwang
Copy link
Author

Forgot to mention the OS is:

System Version: macOS 10.13.1 (17B48)
Kernel Version: Darwin 17.2.0

JDK and JRE were downloaded from Oracle.

@bruno-medeiros
Copy link
Contributor

Note that the error message is not true, Goclipse does start successfully despite what the message says, so you can just keep using it. As a workaround, locate the plugins directory in the Eclipse installation, and delete the com.googlecode.goclipse.jvmcheck_1.0.0.v201607061938.jar file, this will prevent the error message from being shown.

@markus-wa
Copy link

markus-wa commented Jan 12, 2018

As a workaround, locate the plugins directory in the Eclipse installation, and delete the com.googlecode.goclipse.jvmcheck_1.0.0.v201607061938.jar file, this will prevent the error message from being shown.

I can't find this jar. I'm on Windows with Eclipse Oxygen 4.7.2 and JDK 9.0.1 and installed GoClipse via marketplace.

GoClipse appears to work anyway like you said, but it's still slightly annoying.

@bdobby
Copy link

bdobby commented Feb 3, 2018

I have same setup as @markus-wa . The file is there on my system. Note the file is com.googlecode... not com.google...

@myrlyn
Copy link

myrlyn commented Mar 1, 2018

This appears to be due to the change in versioning scheme by JDK.
Previous version scheme was (essentially) 1.MAJOR.MINOR-release
New versioning schems is MAJOR.MINOR.RELEASE
So "public static int getJavaVersion()" only parses the second number in the version string. Since the JDK 9 version is 9.0.4, it parses '0'. The method needs to parse the first entry, and return that if it is higher than '1'. I'll try to submit a merge request with this later.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants