Java version problem with Eclipse and NetBeans on 18.04

The current version of NetBeans from the default Ubuntu repositories is 10.0 in Ubuntu 18.04 and later. NetBeans 10 is compatible with either openjdk-8-jdk or openjdk-11-jdk in 18.04. To install it open the terminal and type:

sudo apt install openjdk-8-jdk netbeans  

or

sudo apt install openjdk-11-jdk netbeans 

The eclipse snap package works well with Java in Ubuntu 18.04 too.

sudo snap install eclipse --classic