From BITPlan Wiki
Jump to navigation Jump to search

Why Java 8 is not dead

  • Because Java 9 breaks things
  • Because Java 10 breaks more things
  • Because Java 11 breaks even more things
  • Because Java >=12 broke more of the stuff that has been working perfectly for years

And the cost/benefit relation of moving along Oracle's ideas seems not worthwile.

What can you do ??

  1. Stick to Java 8
  2. Move to another programming language like Python, Javascript or any other competitor of Java

Stick to Java 8

sudo apt install openjdk-8-jdk
sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
* 0            /usr/lib/jvm/java-11-openjdk-armhf/bin/java      1111      auto mode
  1            /usr/lib/jvm/java-11-openjdk-armhf/bin/java      1111      manual mode
  2            /usr/lib/jvm/java-8-openjdk-armhf/jre/bin/java   1081      manual mode

Press <enter> to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/lib/jvm/java-8-openjdk-armhf/jre/bin/java to provide /usr/bin/java (java) in manual mode
wf@raspberrypi:~/source/java/com.bitplan.dac $ java -version
openjdk version "1.8.0_312"
OpenJDK Runtime Environment (build 1.8.0_312-8u312-b07-1+rpi1-b07)
OpenJDK Client VM (build 25.312-b07, mixed mode)




Mediawiki-Japi/src/main/java/com/bitplan/mediawiki/japi/api/[34,33] package javax.xml.bind.annotation does not exist


Oracle decided to remove APIs


Do not use Oracle's incompatible Java versions - stay with Version 8

diff --git a/.travis.yml b/.travis.yml
 # this is a java project using maven
 language: java
+# make sure things keep working see
+jdk: openjdk8

Crashing Eclipse


Trying to start Eclipse oxygen leads to multiple ClassNotFoundExceptions



Surprise - stay with Java 8 ... Search it:

/usr/libexec/java_home -v 1.8

and add it to your eclipse.ini (make sure using two lines as below ...


Hazelcast not starting properly


java: WARNING: Hazelcast is starting in a Java modular environment (Java 9 and newer) but without proper access to required Java packages. Use additional Java arguments to provide Hazelcast access to Java internal API. The internal API access is used to get the best performance results. Arguments to be used:

java:  --add-modules --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/ --add-opens --add-opens

and then it doesn't work / the tcp connections fail


Code not working without changes


Surprise - stay with Java 8 ...

Incompatible Javadoc


[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.0.1:jar (attach-javadocs) on project MavenReportException: Error while generating Javadoc: 

[ERROR] Exit code: 1 - javadoc: error - The code being documented uses modules but the packages defined in are in the unnamed module.


[ERROR] Command line was: /usr/local/lib/jvm/openjdk11/bin/javadoc -Xdoclint:none @options @packages


java -Xmx32m -version

openjdk version "11.0.2" 2019-01-15

Java 11 javadoc is incompatible to prior versions


Surprise - stay with Java 8 ...

mvn site fails


org.apache.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19
    at org.apache.bcel.classfile.Constant.readConstant (