0

Ubuntu 18.04 user here!

I'm going to use Java to program embedded systems such as the boards:

  • Raspberry Pi
  • STM32429I-EVAL
  • 32F746GDISCOVERY
  • Intel Galileo Gen. 2.

They are not so many, but they are still very powerfull and can be used to a lot of things for industrial applications. More boards will come in the future.

Anyway. I have some trouble when to install the Java ME SDK (Source Development Kit).

What I did first is to install OpenJDK 11

sudo apt-get install openjdk-11-jdk

I checked the version

hp@hp-HP-Z400-Workstation:~/Hämtningar$ java -version
openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.2)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.2, mixed mode)
hp@hp-HP-Z400-Workstation:~/Hämtningar$ 

And then I checked where I installed the OpenJDK

hp@hp-HP-Z400-Workstation:~$  readlink -f $(which java) 
/usr/lib/jvm/java-11-openjdk-amd64/bin/java
hp@hp-HP-Z400-Workstation:~$ cd /usr/lib/jvm/
hp@hp-HP-Z400-Workstation:/usr/lib/jvm$ ls
java-1.11.0-openjdk-amd64  java-11-openjdk-amd64
hp@hp-HP-Z400-Workstation:/usr/lib/jvm$ 

So there are two folders of my OpenJDK 11:

  • java-1.11.0-openjdk-amd64
  • java-11-openjdk-amd64

Then I tried to install the Java ME SDK 8.3 for Ubuntu Linux

  • oracle-jmesdk-8-3-rr-linux-bin.sh

I downloaded the file and run it:

hp@hp-HP-Z400-Workstation:~/Hämtningar$ sudo sh oracle-jmesdk-8-3-rr-linux-bin.sh
[sudo] lösenord för hp: 
Configuring the installer...
Searching for JVM on the system...
Java Runtime Environment (JRE) was not found at the specified location 
Preparing bundled JVM ...
Extracting installation data...
Running the installer wizard...

Then I got this installation wizard on the screen. Notice that this wizard won't recognize any JDK from the folders java-1.11.0-openjdk-amd64 or java-11-openjdk-amd64

enter image description here

I also tried to install an older version for Oracle JDK.

sudo add-apt-repository ppa:linuxuprising/java
sudo apt-get install oracle-java10-installer

And I checked the version:

hp@hp-HP-Z400-Workstation:~/Hämtningar$ java -version
java version "10.0.2" 2018-07-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)
hp@hp-HP-Z400-Workstation:~/Hämtningar$

And also the installation:

hp@hp-HP-Z400-Workstation:~$ readlink -f $(which java) 
/usr/lib/jvm/java-10-oracle/bin/java
hp@hp-HP-Z400-Workstation:~$ cd /usr/lib/jvm/
hp@hp-HP-Z400-Workstation:/usr/lib/jvm$ ls
java-10-oracle
hp@hp-HP-Z400-Workstation:/usr/lib/jvm$ 

I tried the same installation wizard again:

enter image description here

Question:

Why can't the installation wizard for Java ME SDK recognize neither OracleJDK or OpenJDK?

  • 1
    Did you try sudo apt install openjdk-8-jdk? update-java-alternatives which is installed when openjdk-8-jdk is installed allows the user to manually choose which Java to use before running an application. – karel Oct 13 '18 at 1:31
  • It worked karel! – Daniel Mårtensson Oct 13 '18 at 10:38
  • You can click the gray checkmark beside your answer to mark your own answer as accepted 48 hours after when you asked this question. – karel Oct 13 '18 at 10:52
0

Here is the solution.

I installed the OpenJDK 8 and OpenJDK 11

sudo apt install openjdk-11-jdk openjdk-8-jdk

Then I tried to run the installation wizard again:

enter image description here

It worked! OpenJDK 8 is the right JDK to use with Java ME 8.3.

Two more issues for Oracle:

  1. OpenJDK 8 will be out of updates at Januari 2019 for non-commercial users.
  2. When I tried the java -version command if found this:

     hp@hp-HP-Z400-Workstation:~/Hämtningar$ java -version
     openjdk version "10.0.2" 2018-07-17
     OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.2)
     OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.2, mixed   mode)
     hp@hp-HP-Z400-Workstation:~/Hämtningar$ 
    

I don't know why it stands OpenJDK 10, when I installed both OpenJDK 8 and OpenJDK 11.

  • OpenJDK 10 is the package maintainer's way of saying that what was once JDK 9 will be updated to whatever the package maintainers think is the best version which currently is JDK 11. OpenJDK 8 is required by some programs, for example NetBeans. In the case of NetBeans, either the maintainers of NetBeans will upgrade the package or else you will have to continue to have OpenJDK 8 installed in order for NetBeans to keep on working. – karel Oct 13 '18 at 10:58
  • But yesterday, I checked the version of java, I saw OpenJDK 11. Is it something wrong with my Ubuntu? I use Eclipse. – Daniel Mårtensson Oct 13 '18 at 11:02
  • The package maintainers decision was that openjdk-11-jdk would be the next JDK version after openjdk-8-jdk in Ubuntu 18.04. I've got both installed on my Ubuntu 18.04, and apt policy openjdk-11-jdk returns Installed: 10.0.2+13-1ubuntu0.18.04.2. I use both openjdk-8-jdk and openjdk-11-jdk in Eclipse and my Eclipse settings look like this: askubuntu.com/questions/1082366/…, Please upvote it. – karel Oct 13 '18 at 11:06
  • So if I want to install OpenJDK 11, I need to install it manually from Java.net ? – Daniel Mårtensson Oct 13 '18 at 11:15
  • Ubuntu already has JDK 11 in Ubuntu 18.10 which will be officially released in a few days. You can probably manually download JDK 11 from the official Ubuntu website and install it in 18.04. In 18.10 openjdk-11-jdk really means JDK 11. – karel Oct 13 '18 at 11:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.