1

I'm having trouble running Cytoscape 3.9.1 on MacOS Big Sur. The system checker fails with the following:

############# Cytoscape System Requirements Checker for Mac ##############
Target Cytoscape version: 3.9.0
Your shell is bash
Compatible OS version found: 11.6
 - Pass: OS Version = 11.6.1
 - Pass: Following Oracle JDK found:

/Library/Java/JavaVirtualMachines/jdk-11.0.5.jdk
Fail: Java is not reachable.
Try re-installing Java 11.

I have Java 11 installed at the location shown in the output, and it seems fine:

$ /Library/Java/JavaVirtualMachines/jdk-11.0.5.jdk/Contents/Home/bin/java -version
java version "11.0.5" 2019-10-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.5+10-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.5+10-LTS, mixed mode)

Permissions look right (these are the same all the way up the directory hierarchy):

$ ls -lh /Library/Java/JavaVirtualMachines/jdk-11.0.5.jdk/Contents/Home/bin/
total 6672
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 jaotc
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 jar
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 jarsigner
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 java
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 javac
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 javadoc
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 javap
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 jcmd
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 jconsole
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 jdb
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 jdeprscan
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 jdeps
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 jhsdb
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 jimage
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 jinfo
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 jjs
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 jlink
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 jmap
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 jmod
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 jps
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 jrunscript
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 jshell
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 jstack
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 jstat
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 jstatd
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 keytool
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 pack200
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 rmic
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 rmid
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 rmiregistry
-rwxr-xr-x  1 root  wheel   101K Oct  6  2019 serialver
-rwxr-xr-x  1 root  wheel   110K Oct  6  2019 unpack200

I also have several more up-to-date Java versions installed (I'm not sure if these are causing the issue):

$ ls /Library/Java/JavaVirtualMachines/
jdk-10.0.2.jdk      jdk-12.0.2.jdk      jdk-14.0.1.jdk      jdk1.8.0_181.jdk
jdk-11.0.5.jdk      jdk-13.0.2.jdk      jdk-17.0.1.jdk

The default is JDK17:

$ java -version
java version "17.0.1" 2021-10-19 LTS
Java(TM) SE Runtime Environment (build 17.0.1+12-LTS-39)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.1+12-LTS-39, mixed mode, sharing)

If I invoke cytoscape.sh directly from the command line, it appears to be trying to run under Java 8:

$ ./cytoscape.sh 
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/cytoscape/launcher/internal/Launcher has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495)
James_D
  • 201,275
  • 16
  • 291
  • 322

2 Answers2

2

Cytoscape 3.9.1 will not run on JDK 17. You need to set your JAVA_HOME to point to your JDK 11 installation and things should work.

-- scooter

Scooter Morris
  • 1,269
  • 1
  • 7
  • 4
  • Thanks: that works, though the only way I can find to do that is to run `export JAVA_HOME=...; ./cytoscape.sh` from the terminal. It's a little inconvenient but workable. – James_D May 03 '22 at 11:42
1

I had a similar issue with Java. So I'm including my answer here if anyone else has the same issue as me. First I went here to find out "How to set or change the default Java (JDK) version on macOS?"

From there you should be able to find out the Java version you want to use. Then set your JAVA_HOME variable

Using bash or zsh you can set your JAVA_HOME environment variable like so:

Bash Example

echo export "JAVA_HOME=\$(/usr/libexec/java_home -v 11.0.7)" >> ~/.bash_profile

or in Zsh

echo export "JAVA_HOME=\$(/usr/libexec/java_home -v 11.0.7)" >> ~/.zshrc

Restart terminal after this.

You can check your shell profile and see that this line has now been added to the end of the profile:

nano ~/.bash_profile
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.7.jdk/Contents/Home

You can also check that java is mapped to the desired Java version by default now:

java -version

Running the System Checker Script on Mac should now recognize Java is installed correctly

./mac.sh

Cytoscape should now run by clicking on the cytoscape.sh script

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
  • That's fine, as long as you want your default JVM to be Java 11. I need it to be Java 17 (or later) for other reasons. – James_D Jun 13 '22 at 17:08