SpencerPark / IJava

A Jupyter kernel for executing Java code.
MIT License
1.1k stars 217 forks source link

kernel does not recognizes versions of Runtime up to 52.0 #44

Closed aviniciux closed 5 years ago

aviniciux commented 5 years ago

Hi,

I got to install the kernel ok, but when I open jupyter-notebook and I choose the java kernel, it appears this error on terminal:

Error description:

Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.UnsupportedClassVersionError: io/github/spencerpark/ijava/IJava has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0

I'm using Linux Fedora 28 KDE

and I've instaled the kernel using skd-9.0.4

My system out to java -version is:

java version "1.8.0_191" Java(TM) SE Runtime Environment (build 1.8.0_191-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)

SpencerPark commented 5 years ago

Hello @aviniciux, as you imply (in mentioning you installed skd-9.0.4), the installation requirements specify that java 9 is required to run the kernel.

You have java 8 in your PATH. Maybe you have multiple versions installed (check with which -a java) in which case you will need to make sure to put java 9 at the front of your PATH. I'm not sure what is in skd-9.0.4, if you are still having trouble I could take a look at a link to the package page to make sure it contains a compatible version.

aviniciux commented 5 years ago

Hello @aviniciux, as you imply (in mentioning you installed skd-9.0.4), the installation requirements specify that java 9 is required to run the kernel.

You have java 8 in your PATH. Maybe you have multiple versions installed (check with which -a java) in which case you will need to make sure to put java 9 at the front of your PATH. I'm not sure what is in skd-9.0.4, if you are still having trouble I could take a look at a link to the package page to make sure it contains a compatible version.

Hi @SpencerPark . Yep, in fact, it seems the problem was having multiple versions of java. But when we go to the oracle website to download Java SE, both SDK and JRE, (https://www.java.com/en/download/) it goes automatically to version 1.8.0_191, as it's the most recent version (and I got the error above just using this version, so that it says that my version is older than the required). At the description of the Java Kernel, the requirements is Java "9". I'm completely newbie in relation to the numbering rules to Java versions, but it seems to me that Oracle also has multiple ways to numbering Java. Anyway, this was my failure to understand. I'm sorry for the confusion.

I solved the problem just removing all the 1.8.0_191 versions and installing the JDK 11 from this place, and using it for both install and run the kernel.

Tkx,   -- | --

SpencerPark commented 5 years ago

But when we go to the oracle website to download Java SE, both SDK and JRE, (https://www.java.com/en/download/) it goes automatically to version 1.8.0_191, as it's the most recent version

Thank you, this information is very helpful. I wasn't aware that is the default download. On that note it is also good to know that this is the website you went to (as many others will likely end up in the same place) but that download is also for the JRE and not the JDK. This clearly needs a note in the README.

Some good places to go are:

On these types of questions I like to try and give a little extra information (sorry if I seem condescending for repeating lots of information you likely know) as other people tend to end up reading these issues from googling their problem and the hope is to cut down on duplicate issues but trying to solve related ones at the same time :)

Glad you got the installation issue fixed!