updater weirdness on OSX

I2P router issues
Post Reply
jogger
Posts: 45
Joined: 19 Feb 2018 09:00

updater weirdness on OSX

Post by jogger »

Just upgraded to 0.9.36 from source.

Used "ant updater" with javac.version set to the destination platform. Build system is 32-bit Armbian 5.3.8 Stretch with OpenJDK 10.0.1. i2pupdate.zip produced works fine on Linux with OpenJDK 9.0.4 and 10.0.1.

On latest OSX with Java 10.0.2 I get after updating: WrapperSimpleApp Error: Class net.i2p.router.Router found but could not be initialized: java.lang.UnsupportedClassVersionError: net/i2p/router/Router has been compiled by a more recent version of the Java Runtime (class file version 54.0), this version of the Java Runtime only recognizes class file versions up to 53.0.

Installation is wrecked afterwards. Does not update anymore. Overwriting with stock 0.9.36 OSX installer does not help. I needed to delete /Applications/i2p and again installed from stock 0.9.36 OSX installer.

I can swear this worked for earlier Java 10 versions an OSX.
meeh
Posts: 8
Joined: 16 Feb 2018 19:08

Re: updater weirdness on OSX

Post by meeh »

Hi,

Did you might alter the build.xml as well? Usually ant should set the target to java 1.7 (51) and not 54 which is JDK 10.

I suspect you might have JAVA_HOME point to JDK9 by mistake maybe? Since it's complaining about that it's not 53.

Ref. https://en.wikipedia.org/wiki/Java_class_file for java versions.
jogger
Posts: 45
Joined: 19 Feb 2018 09:00

Re: updater weirdness on OSX

Post by jogger »

Thanks, mentioning JDK9 was helpful.

The fault is with Apple as well as with i2p.

There in fact exists a JDK 9.0.1 on the target machine I was not aware of. It is the only one that can be found on the command line using various methods (java -version; find / -name javac; /usr/libexec/java_home). No way to set a different JAVA_HOME, which was not set at all.

Apple must have changed something in depth, since in the User Interface everything like jcontrol points to JRE 10.0.2 only.

A short test revealed that Java 9 is started when using "java -jar test.jar"
Java 10 is started by "open test.jar", which is equivalent to double-clicking in the UI.

Since the first method is deprecated, i2p should change the i2prouter script to use the "open" command on OSX.

Maybe some expert for Java 10 on OSX can come up with a workaround in between.
jogger
Posts: 45
Joined: 19 Feb 2018 09:00

Re: updater weirdness on OSX

Post by jogger »

Found the workaround myself. First I would not trust "ps -ef | grep java", but Java 10 is buried in a really weird location. So you can do:

export JAVA_HOME="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home"

You can also see this in the Java Control Panel in the "Desktop Settings" tab, after maximizing the way too short "Path" column.

Also tried "/usr/libexec/java_home -V" on a different machine, lists all installed java versions except Java 10.
jogger
Posts: 45
Joined: 19 Feb 2018 09:00

Re: updater weirdness on OSX

Post by jogger »

Now opened Trac ticket https://trac.i2p2.de/ticket/2299#ticket.

Included a quick fix to "runplain.sh" there which can be used as a workaround.
Post Reply