Frage

I've made a hello world java program to test how jmxremote works:

public class Main {
    public static void main(String argv[]) {
        try {
            System.out.println("Press  to continue...");
            System.in.read();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

compiled it with javac Main.java, and run it like

java -Dcom.sun.management.jmxremote \ -Dcom.sun.management.jmxremote.port=9010 \ -Dcom.sun.management.jmxremote.local.only=false \ -Dcom.sun.management.jmxremote.authenticate=false \ -Dcom.sun.management.jmxremote.ssl=false \ Main

However the port never gets opened:

# telnet localhost 9010
Trying ::1...
telnet: connect to address ::1: Connection refused

(nc -l and netstat show same results). Java version is

java version "1.5.0"
gij (GNU libgcj) version 4.4.7 20120313 (Red Hat 4.4.7-4)

and OS is Centos 6.5 (java installed from default repo with yum).

How do I fix this?

I've tried messing up the option names, but never got any info about an error - is jmx even available in java 1.5?

War es hilfreich?

Lösung

Like peoples say, libgcj is not a very good idea. It was a poor try from GNU peoples to fork a GPL licensed JVM that will compile java code to machine code, not byte code. It's now a dead project that never supported JMX.

A yum install java-1.7.0-openjdk-devel will provide what you need.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top