Hot questions for Using Ubuntu in jvm


I am able to connect to JMC to the JVM while on the same system. However, I want to monitor a remote server. How do I connect my local JMC to my remote JVM?


It's all described in the documentation: 1. Click Help->Java Mission Control Help. 2. Check the JVM browser help.

For more detailed information, check out:

First you need to enable the external JMX agent on the server. You do this by adding the relevant to the command line flags for the server JVM you wish to connect to. Here is a simple example of a set of system properties that can be used. They disable security and authentication, so NEVER use it like this in production:

Next you create a custom connection in JMC. You do this by clicking the "Create custom connection" button in the JVM browser:

In the upcoming dialog you simply enter the host and port.

If you run into trouble, first check the last chapter of the documentation included with JMC (Frequently Asked Questions):

If that does not help, the JMC Forum has a more extensive FAQ:


I installed OpenJDK 8 on Ubuntu using sudo apt-get install openjdk-8-jdk, and it was installed to /usr/lib/jvm/java-8-openjdk-amd64.

Where can I find the Java Mission Control (I think called jmc) and VisualVM (I think called jvisualvm) programs?

I assumed both to be installed with the JDK:

  • The Java Mission Control page states that "Starting with the release of Oracle JDK 7 Update 40 (7u40), Java Mission Control is bundled with the HotSpot JVM."
  • The VisualVM page says "March 18th, 2014: JDK 8 has been released and is available for download here. It contains Java VisualVM tool based on VisualVM 1.3.6."

What am I missing? Are both only part of the Oracle JDK, or did I use the wrong install command?

If they are not part of the OpenJDK, can I download them using apt-get install?


Java Mission Control (jmc) is now open source and hosted on GitHub and (as a Mercurial repository).

Official builds are available here.

It is also rather easy to build jmc yourself using the instructions from the readme file:

hg clone
cd jmc/releng/third-party
mvn p2:site
mvn jetty:run

In a different terminal:

cd core
mvn clean install
cd ..
mvn package

After installing, you can close the Jetty server running in the first terminal.

Alternatively, you can use Docker to build jmc:

docker-compose -f docker/docker-compose.yml run jmc

To launch jmc:

  • on Linux: target/products/org.openjdk.jmc/linux/gtk/x86_64/jmc
  • on macOS: target/products/org.openjdk.jmc/macosx/cocoa/x86_64/JDK\ Mission\
  • on Windows: target\products\org.openjdk.jmc\win32\win32\x86_64\jmc.exe

You should see a splash screen now:

More info in this blog post.


I just installed Ubuntu 64Bit on my VServer and JRE build 1.7.0_67-b01. If I want to run a java jar-file it says

Invalid maximum heap size: -Xmx Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

java -help says

java version "1.7.0_67" Java(TM) SE Runtime Environment (build 1.7.0_67-b01) Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

I tried 1M, 256M, 1024M, 2G and 4G for -Xmx, nothing works. Is there a hidden setting I don't know?

Here's the command I use:

java -Xmx 1024M -Xms 1024M -jar MyConverter.jar


Remove the space after Xmx and Xms


Please note:

I've checked other threads -

Cannot run Eclipse; JVM terminated. Exit code=13

Eclipse does not launch (Ubuntu) : JVM terminated. Exit code=13

Which didn't seem to help in my case.

I've installed oracle java 8 package, java -version shows:

java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)

Eclipse was installed with 64-bit installer wizard from official website. When trying to open eclipse i get the following:

JVM terminated. Exit code=13
-jar /home/adiel/eclipse/cpp-neon/eclipse//plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar
-os linux
-ws gtk
-arch x86_64
-launcher /home/adiel/eclipse/cpp-neon/eclipse/eclipse
-name Eclipse
--launcher.library /home/adiel/.p2/pool/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.400.v20160518-1444/
-startup /home/adiel/eclipse/cpp-neon/eclipse//plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar
-exitdata 73000a
-product org.eclipse.epp.package.cpp.product
-vm /usr/lib/jvm/java-8-oracle/bin/java
-jar /home/adiel/eclipse/cpp-neon/eclipse//plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar 

My eclipse.ini file:


Ubuntu 16.04 LTS . Any suggestions? Thanks


Solution found.

Removed java-8-install using sudo apt-get purge,

Installed openjdk-8-jdk instead, then reinstalled eclipse package through their installer.

Now eclipse is working.


I have created a Java project in NetBeans and the automatically built distribution file (.jar) runs absolutely fine on my Ubuntu 15.04 AMD64 machine.

I wanted to make sure it runs on windows before I distribute it, but having tested on a windows 7 32 bit machine I found it doesn't work. Below is a screen shot of the error message.

I can guess at some issues - in that it talks about a .regex error. I don't really use regex in my code but use String.split which I think calls on the regex package - that is in my constructor for the FileHandler class. So it looks like that is an issue.

You can see the full code here on GitHub :

The Java version on the target machine is: 1.8.0_45 As is the same on my build machine.

Any help much much appreciated.

EDIT the specific section causing the problem seems to be the constructor for my FileHandler class. Which looks like this:

public FileHandler() {       

    String path = this.getClass().getProtectionDomain().getCodeSource()

    String[] arry_path = path.split(File.separator);

    path = "";
    for (int i = 0, j = arry_path.length - 1; i < j; i++) {
        path += arry_path[i] + File.separator;

    PASSWORDS = path + "data" + File.separator + "passwords.sec";



This line seems to be your problem.

String[] arry_path = path.split(File.separator);

The file separator on Windows is different from that on a Unix operating system like Ubuntu.

The file separator used in Windows is \ which is a special character in regex and needs to be escaped for the regex to compile.

As pointed out by nneonneo below, this can easily be remedied by changing the line into:

String[] arry_path = path.split(Pattern.quote(File.separator));


So I am trying to build/use hsdis with openJDK-11. if I try to build it with binutils I get the following errors:

hsdis.c:316:32: error: incompatible type for argument 1 of ‘disassembler'
app_data->dfn = disassembler(native_bfd);

hsdis.c:316:19: error: too few arguments to function ‘disassembler’
app_data->dfn = disassembler(native_bfd);

I have tried building it with binutils 2.29, 2.30, 2.31 and 2.32. Got same error with all of them.

If I take a prebuilt binary from JDK-8 and place it in my build folder of JDK, netbeans refuses to acknowledge it is present in the folder. I have set up OpenJDK in netbeans and generated a slowdebug build. I tried running it step by step to see where exactly hsdis is being searched for, to my surprise it does look in the folder where I placed the file however it still says no such file or directory. For me that folder is


I am using VMWare and running Ubuntu 18.04. Any ideas what I can do?


I have tried building it with binutils 2.29, 2.30, 2.31 and 2.32. Got same error with all of them.

The version of the source you have does not work with binutils 2.29+. jdk/jdk has a patch to rectify this. See: Which suggests the following fix to hsdis.c:

diff --git a/src/share/tools/hsdis/hsdis.c b/src/share/tools/hsdis/hsdis.c
index 3d038f1..88122fb 100644
--- a/src/share/tools/hsdis/hsdis.c
+++ b/src/share/tools/hsdis/hsdis.c
@@ -30,6 +30,7 @@
 #include <config.h> /* required by bfd.h */
 #include <libiberty.h>
 #include <bfd.h>
+#include <bfdver.h>
 #include <dis-asm.h>
 #include <inttypes.h>
 #include <string.h>
@@ -312,7 +313,13 @@ static void setup_app_data(struct hsdis_app_data* app_data,

  /* Finish linking together the various callback blocks. */
  app_data->dinfo.application_data = (void*) app_data;
- app_data->dfn = disassembler(native_bfd);
+ app_data->dfn = disassembler(
+#if BFD_VERSION >= 229000000
+ bfd_get_arch(native_bfd),
+ bfd_big_endian(native_bfd),
+ bfd_get_mach(native_bfd),
+ native_bfd);
  app_data->dinfo.print_address_func = hsdis_print_address_func;
  app_data->dinfo.read_memory_func = hsdis_read_memory_func; 


getting the following error while running the XML file on ubuntu terminal i am running the following command

java -cp/home/dev2/eclipse-workspace/seffcon/bin;/home/dev2/eclipse-workspace/seffcon/libs* org.testng.TestNG testng.xml

Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. bash: /home/dev2/eclipse-workspace/seffcon/libs: Is a directory


You are using bash. In the bash shell language, the ; character separates commands. But you appear to be using it as if it was a classpath separator.

On Linux and MacOS and other UNIX-like systems, the classpath separator is : not ;.

The correct command is:

java -cp /home/dev2/eclipse-workspace/seffcon/bin:/home/dev2/eclipse-workspace/seffcon/libs/* org.testng.TestNG testng.xml


  1. colon not semicolon,
  2. a space after -cp, and
  3. a classpath wildcard (to match one or more JAR files) is only recognized after a file separator.