Difference between revisions of "Java8"

From BITPlan Wiki
Jump to navigation Jump to search
Line 35: Line 35:
 
=== Therapy ===
 
=== Therapy ===
 
Surprise - stay with Java 8 ...
 
Surprise - stay with Java 8 ...
 +
Search it:
 
<source lang='bash'>
 
<source lang='bash'>
 
/usr/libexec/java_home -v 1.8
 
/usr/libexec/java_home -v 1.8
 
/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home
 
/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home
 
</source>
 
</source>
 +
and add it to your eclipse.ini (make sure using two lines as below ...
 +
<pre>
 +
-vm
 +
/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin/java
 +
</pre>

Revision as of 18:19, 30 December 2019

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 will surely break 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.

Examples

Mediawiki-Japi

Problem

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

Diagnosis

Oracle decided to remove APIs

Solution

Do not use Oracle's Java - 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 http://wiki.bitplan.com/index.php/Java8
+jdk: openjdk8

Crashing Eclipse

Problem

Trying to start Eclipse oxygen leads to multiple ClassNotFoundExceptions

Diagnosis

Therapy

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

/usr/libexec/java_home -v 1.8
/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home

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

-vm
/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin/java