I have installed Cytoscape 3.8.0, but it doesn't run. However, I navigated to cytoscape.bat to check the issue which gave following error:
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
Also, after checking java version, I got following details:
java 11.0.8 2020-07-14 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.8+10-LTS)
I have also set all the required environment variables for java.
What can I do to resolve this issue?
As stated, you need to install Java 11. Because of the license issues with Oracle JDK, we now test exclusively against OpenJDK. You can get a version of OpenJDK 11 from AdoptJDK
In addition to Java problems, a recent update on Mac has caused OpenCL based Cytoscape Apps to fail and prevents Cytoscape from launching.
This will be fixed in future updates, but you can fix your Mac installation immediately by disabling OpenCL by either of the two following methods:
Download the disable-opencl.dummy file to your CytoscapeConfiguration
directory (in your user home directory).
Or, you can create an empty dummy file by running this command in Terminal:
touch ~/CytoscapeConfiguration/disable-opencl.dummy
These fixes are described at Cytoscape.org.
Related
This question already has answers here:
How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version
(51 answers)
Closed 1 year ago.
I've run into this error a few times trying to brush up on my Java. Looked up solutions on the internet and most suggestions were to compile or run the file with a flag/option argument to specify the correct interpreter version. My question is, is there a more permanent solution to this? (im using vscode. Guessing there is something i can add to my settings.json file in the workspace- but what?)
Error: LinkageError occurred while loading main class com.example.demo.DemoApplication
java.lang.UnsupportedClassVersionError: com/example/demo/DemoApplication has been compiled by a more recent version of the Java Runtime (class file version 59.65535), this version of the Java Runtime only recognizes class file versions up to 58.0
here is my version details
$ java --version
java 14.0.2 2020-07-14
Java(TM) SE Runtime Environment (build 14.0.2+12-46)
Java HotSpot(TM) 64-Bit Server VM (build 14.0.2+12-46, mixed mode, sharing)
Id like to not have to use flags whenever I compile and run a java file from the command line. Bonus points to you if you can explain why this problem happens in the first place? back when i learned java, you used to have to download and install the JRE and JDK separately. I can understand mistakenly downloading incompatible versions, but now it seems the JRE comes prepackaged with the JDK. How is it possible to have incompatible versions of the compiler and interpreter if this is the case?
This error is telling you that your class was compiled at a higher version of Java than the version you are trying to run with. More specifically, in this case, you compiled your class with Java 15 and try to run it with Java 14.
Depending on your situation, you have two ways to resolve the error: compile your code with an earlier version of Java, or run your code on a newer Java version.
Fix via the Command Line. If you're ready to move entirely to a newer JDK, you should download the newer version and make sure your PATH and JAVA_HOME environment variables are set appropriately. Assuming you have Java 15 JRE, you can run your code with the java command packaged with it.
IntelliJ IDEA. You can also control the version of Java you're using for compiling and running in IntelliJ IDEA. Go to File -> Project Structure… -> Project Settings -> Project and change your Project SDK and Project language level. Next run your project on the newer JRE: go to Run -> Edit Configurations… and change your JRE to 15. Now, when you run your project, it will run with the Java 15 JRE.
java.lang.UnsupportedClassVersionError: com/example/demo/DemoApplication has been compiled by a more recent version of the Java Runtime (class file version 59.65535), this version of the Java Runtime only recognizes class file versions up to 58.0
Set the JDK the same one when you compile and run the project:
That's to say, your file was compiled by JDK15, but the current runtime, which is also installed on your machine is JDK14. The dismatch of build and compile jdk version caused this error.
There're two important configurations to correctly configure your environment and project: java.configuration.runtimes and java.home. The former specifies options for your project's execution environment; the latter specifies your language server's execution environment.
You've installed JDK14, set the above two settings to use it can solve this error.
"java.home": "\PATH TO JDK14\",
"java.configuration.runtimes": [
{
"name": "JavaSE-14",
"path": "\PATH TO JDK14\",
"sources": "\PATH TO JDK14\lib\src.zip",
"javadoc": "https://docs.oracle.com/en/java/javase/14/docs/api",
"default": true
},
],
Cleaning the Java Language Server Worspace and reload the window in VS Code, then run again.
More information about java.configuration.runtimes and java.home, please refer to Configure JDK.
I know that this appears everywhere with a bunch of threads but I followed the instructions and it did not work!
I get the following error:
cannot access java.lang.Object
bad class file: /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/rt.jar(java/lang/Object.class)
class file has wrong version 52.0, should be 48.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
public static void main (String [] args){
^
1 error
I downloaded the latest runtime, and the latest JDK. If I do /java version in Terminal (I'm using Mac), I get:
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)XXXXX-MacBook-Pro:~ XXXXX$
What should I do now? I set the JAVA_HOME and it still doesn't work. Thanks for your help.
I believe you answered your own question. You are currently using 1.8, which is greater than the required 48 (see here). To use version 48, you will have to install JDK 1.4. Also, make sure your system paths point to the 1.4 version after you've installed it.
Do a which java in your terminal and then go into that directory or run that executable with the --version switch to verify the version number. Sometimes, the installer will default to the newer version of Java while maintaining symbolic links to the older versions in the same folder. You will have to relink your Java to the older, 1.4 version if this is the case.
I am a fairly new linux user and I therefore have no idea where the error might come from. As I was trying to install Matlab (R2013a) on opensuse I had the following error:
/tmp/mathworks_2336/sys/java/jre/glnxa64/jre/bin/java -Xmx512m -splash:"/home/desertfox/iso/java/splash.png" -Djava.ext.dirs=/tmp/mathworks_2336/sys/java/jre/glnxa64/jre/lib/ext:/tmp/mathworks_2336/java/jar:/tmp/mathworks_2336/java/jar/ja_JP/:/tmp/mathworks_2336/java/jar/zh_CN/:/tmp/mathworks_2336/java/jarext:/tmp/mathworks_2336/java/jarext/axis2/:/tmp/mathworks_2336/java/jarext/guice/:/tmp/mathworks_2336/java/jarext/webservices/ com/mathworks/professionalinstaller/Launcher -root "/home/desertfox/iso" -tmpdir "/tmp/mathworks_2336"
Installing ...
dl failure on line 685Error: failed /tmp/mathworks_2336/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so, because /tmp/mathworks_2336/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so: invalid ELF header
Finished
I have previously mounted the .iso file and launched the following command in the mounted folder: ./install -v, with no sucess as you can see above.
What could be the error? Java?
I have checked my java version which I believe is up to date.
linux-a6xj:/home/desertfox/iso # java -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Any Suggestion?
Thank you in advance for any help.
PS: I looked at almost all the posts and I did try the chmod+x sys/java/jre.. as mentionned here
MATLAB on Linux may still not yet be compliant with Java 7. Uninstall JDK 7 and try again. Install openjdk-6-jre if it still doesn't work, but it should work on its own.
I have set the Module SDK to 1.6
I have also set the Project SDK to 1.6
and I also change Java compiler options from setting to use java 6
but still it is using java 7 to compile. When I compile or run it gives following error
Using javac 1.7.0_11 to compile java sources
java: Errors occurred while compiling module 'SSLJava6'
Compilation completed with 1 error and 0 warnings in 1 sec
1 error
0 warnings
java: javacTask: source release 1.7 requires target release 1.7
Has anyone faced such problem before? What must be done?
Output of java -version
[aniket#localhost jndiProperties]$ java -version
java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
and my JAVA_HOME is also set to same.
Interesting.
Questions:
Check that c:\Users\$user\.IntelliJIdea12\config\options\jdk.table.xml has a reference to JDK6 only. This is what the file looks like for me:If there is a reference to a JDK 7 in there then delete the corresponding <jdk> element and restart Intellij.
I know that you have confirmed the java and javac path. Confirm the javac being used by writing a simple HelloWorld.java in a brand new Intellij project. If in the new project javac6 is used, then it's an issue with the old project configuration.
If there is a public JRE 7 lurking about, try un-installing it temporarily. After un-installation check that there is no cruft left behind in the Windows registry at HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment
Check whether the build fails if you rename the JDK7 home dir. If so, try symlinking the JDK7 dir to point to the Java6 installation dir. In the windows world the following will work to do the symlink : mklink /J c:\Java7Home c:\ExistingJava6Home
Try setting your IDEA_JDK_64 environment variable to point to your java SDK you want intelliJ to use for example 'D:\Programs\Java\jdk1.9'.
I encountered this issue when installing the new java 9 early access jdk and trying to run it on intelliJ 15.
This fixed it on IntelliJ 16 EAP versions.
This question already has answers here:
How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version
(51 answers)
Closed 6 years ago.
When I ran a java program I received this error.. Could you please suggest why do we get this error:
Exception in thread "main" java.lang.UnsupportedClassVersionError:
GenerateInvoice (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
This class was compiled with a JDK more recent than the one used for execution.
The easiest is to install a more recent JRE on the computer where you execute the program. If you think you installed a recent one, check the JAVA_HOME and PATH environment variables.
Version 49 is java 1.5. That means the class was compiled with (or for) a JDK which is yet old. You probably tried to execute the class with JDK 1.4. You really should use one more recent (1.6 or 1.7, see java version history).
Another option is to delete all the classes and rebuild. Having build file is an ideal solution to control whole process like compilation, packaging and deployment. You can also specify source/target versions
The code was most likely compiled with a later JDK (without using cross-compilation options) and is being run on an earlier JRE. While upgrading the JRE is one solution, it would be better to use the cross-compilation options to ensure the code will run on whatever JRE is intended as the minimum version for the app.
This was a fresh linux Mint xfce machine
I have been battling this for a about a week. I'm trying to learn Java on Netbeans IDE and so naturally I get the combo file straight from Oracle. Which is a package of the JDK and the Netbeans IDE together in a tar file located here.
located
http://www.oracle.com/technetwork/java/javase/downloads/index.html
file name
JDK 8u25 with NetBeans 8.0.1
after installing them (or so I thought) I would make/compile a simple program like "hello world" and that would spit out a jar file that you would be able to run in a terminal. Keep in mind that the program ran in the Netbeans IDE.
I would end up with this error: java.lang.UnsupportedClassVersionError:
Even though I ran the file from oracle website I still had the old version of the Java runtime which was not compatible to run my jar file which was compiled with the new java runtime.
After messing with stuff that was mostly over my head from setting Paths to editing .bashrc with no remedy.
I came across a solution that was easy enough for even me. I have come across something that auto installs java and configures it on your system and it works with the latest 1.8.*
One of the steps is adding a PPA wasn't sure about this at first but seems ok as it has worked for me
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
domenic#domenic-AO532h ~ $ java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) Server VM (build 25.25-b02, mixed mode)
I think it also configures the browser java as well.
I hope this helps others.