This tutorial explains how to fix the ‘Unrecognized VM option MaxMetaspaceSize‘ error. One of the prerequisites for the plugin is to install Oxd server and run it on port 8099. The error “Unrecognized VM option MaxMetaspaceSize=256m” prevented the creation of Java Virtual Machine.

Oxd-server daemon is dependent on Java. Let's check the version of Java using the below command.

root@opidclient:~# java -version
 java version "1.7.0_181"
 OpenJDK Runtime Environment (IcedTea 2.6.14) (7u181-2.6.14-0ubuntu0.1)
 OpenJDK 64-Bit Server VM (build 24.181-b01, mixed mode)

The Java version 1.7.0 does not recognize VM option MaxMetaspaceSize, instead MaxPermSize should be used. However MaxMetaspaceSize is supported in Java Version 8 (i.e., java 1.8). So let’s install Oracle Java version 8 as shown below:

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update 
$ sudo apt-get install oracle-java8-installer
$ sudo apt-get install oracle-java8-set-default

Let’s check the version of Java:

root@opidclient:~# java -version
 java version "1.8.0_171"
 Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
 Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

Now, I tried starting oxd-server and it worked.

root@opidclient:~# /etc/init.d/oxd-server start
 Starting oxd-server:
 Checking logs for possible errors:
 PID: [3797]
 OK Thu Jun 28 07:27:22 UTC 2018
 root@opidclient:~# ps -aef|grep oxd
 jetty 3797 1 51 07:27 ? 00:00:04 /usr/bin/java -server -Xms256m -Xmx512m -XX:MaxMetaspaceSize=256m -XX:+DisableExplicitGC -Doxd.server.config=/etc/oxd/oxd-server/oxd-conf.json -Dlog4j.configuration=/etc/oxd/oxd-server/log4j.xml -cp /opt/oxd-server/lib/bcprov-jdk15on-1.54.jar:/opt/oxd-server/lib/oxd-server-jar-with-dependencies.jar -Doxd.logging.dir=/var/log/oxd-server -Doxd.home=/opt/oxd-server -Doxd.base=/opt/oxd-server org.xdi.oxd.server.ServerLauncher oxd-server.state=/opt/oxd-server/oxd-server.state start-log-file=/var/log/oxd-server/start.log
 root 3827 1581 0 07:27 pts/0 00:00:00 grep --color=auto oxd
root@opidclient:~# telnet 0 8099
 Connected to 0.
 Escape character is '^]'.

That’s it!

Was this answer helpful? 0 Users Found This Useful (0 Votes)