Open drjwbaker opened 8 years ago
You need Java 7 installed (more info here)
So I need 7 as well as 8?
Ah, no. The error is consistent with Java 6 being the active version. What do you get if you print the Java version? e.g.
$ java -version
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)
java version "1.6.0_65" Java(TM) SE Runtime Environment (build 1.6.0_65-b14-468-11M4833) Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-468, mixed mode)
(though elsewhere it says I'm on Java 8 Update 91)
So, is the JAVA_HOME environment variable set?
echo $JAVA_HOME
Because that can override the system default.
If that's not set, then you should be able to change the system Java version via System Preferences.
That does nothing.
(that is echo $JAVA_HOME
)
Happy to help hack with it @drjwbaker while we're in the same room – but for example, my JAVA_HOME
is
/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home
(And when I've had to say downgrade Java for earlier versions of Gephi, etc., I manually override it to point to one of the other two versions of Java I have in /Library/Java/JavaVirtualMachines/
)
Thanks both! Don't mind hacking through these kind of problems but always good to flag them if they are generic.
Yep, very very helpful. I will document this once you confirm that it works. 😀
Two options I can think of. First, there's a hard-coded hook to Java 6 in your PATH. See
echo $PATH
Second, that Java 6 is set as your system default, which you change via the Java tab of the Java Control Panel which you can get to via System Preferences on OS X.
Right. Back on this. echo $PATH
gives me:
//anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/munki:/Library/Application Support/pinpoint/bin
Can't see how to change to change my version of Java in the Java Control Panel.
It's there I promise!
Failing that, you can set JAVA_HOME as shown here: http://stackoverflow.com/a/24657630
It's under "Java Runtime Environment Settings", as noted here https://java.com/en/download/help/mac_controlpanel.xml - see second image on this page for what it should look like: http://stackoverflow.com/questions/14304996/java-7-jre-installed-but-not-enabled-on-osx-mountain-lion
I'd found that. Won't let me change Java's though. I just see 1.8.0_91. Do I need to install a different version of Java then? (stops Macs et cetera!)
Mac, OS X El Capitan.
When doing anything with
mvn
in the Terminal I get the error: