In order to build SDN testbed, I have installed VirtualBox to run Mininet and OpenDayLight controller. Hence, to install and run OpenDayLight, I have followed this tutorial. No problem occurred until I tried to actually run the command ./karaf from within the vm terminal.

It shows me the following message:

./karaf: 242: [: Illegal number:  

OpenJDK 64-Bit Server VM warning: Option UnsyncloadClass was deprecated in 
 version 10.0 and will likely be removed in a future release. 
OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize;
 support was removed in 8.0

-Djava.endorsed.dirs=/usr/lib/jvm/default java/jre/lib/endorsed:/usr/lib/jvm/default
 java/lib/endorsed:/home/odlc/distribution-karaf-0.4.0 Beryllium/lib/endorsed
is not supported. Endorsed standards and standalone APIs in modular
form will be supported via the concept of upgradeable modules. 

Error: Could not create the Java Virtual Machine. 

Error: A fatal exception has occurred. Program will exit.

How to fix this issue?


I am assuming you installed Ubuntu 18.04 Server when you followed the tutorial.

If so, I think the problem might be related to the version of Java installed. In 18.04 the package default-jre-headless installs OpenJDK 11. I tried with this and received the same error as you.

It looks like it does work with OpenJDK 8 and you should be able to resolve this as follows:

Remove OpenJDK 11

sudo apt remove default-jre-headless
sudo apt autoremove

Add Universe Software Repository (Required for OpenJDK 8)

sudo add-apt-repository universe

Install OpenJDK 8

sudo apt install openjdk-8-jre-headless

Amend bashrc

Open the file ~/.bashrc and amend the line you added previously to:

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

Re-run the amended file with source ~/.bashrc and then try running karaf again.

  • Thank you. You are right all the way: It's a Java compatibility issue with Ubuntu 18.04. What I did is a little different though. I just downgraded my Java version. – McLan Jul 30 '18 at 15:10

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.