2

I cannot figure out how to start java with JMX without authentication. It still fails because it cannot find password file:

> java -Dcom.sun.management.jmxremote.port=7091 ‑Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -version

Error: Password file not found: /usr/lib/jvm/java-17-openjdk-amd64/conf/management/jmxremote.password

jdk.internal.agent.AgentConfigurationError
    at jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap.checkPasswordFile(ConnectorBootstrap.java:595)
    at jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap.startRemoteConnectorServer(ConnectorBootstrap.java:437)
    at jdk.management.agent/jdk.internal.agent.Agent.startAgent(Agent.java:447)
    at jdk.management.agent/jdk.internal.agent.Agent.startAgent(Agent.java:599)
> java -version
openjdk version "17.0.15" 2025-04-15
OpenJDK Runtime Environment (build 17.0.15+6-Ubuntu-0ubuntu122.04)
OpenJDK 64-Bit Server VM (build 17.0.15+6-Ubuntu-0ubuntu122.04, mixed mode, sharing)

There are no environment vars like JAVA_OPTIONS etc set.

Is unauthenticated access even still possible?

1 Answer 1

5

One of the characters in your command-line is not the character - you expect but an unicode char which will probably be ignored by the Java interpreter, according to hexed. It it is the one that looks like a dash/minus character one before Dcom.sun.management.jmxremote.authenticate:

java -Dcom.sun.management.jmxremote.port=7091 ‑Dcom.sun.management.jmxremote.authenticate=false ...
                                              ^
              this character is not a dash/minus, but a unicode character
Sign up to request clarification or add additional context in comments.

4 Comments

Holy cow, what a stupid copy &paste error. Thank you so much!
Happens all the time, usually related with people copy pasting on enriched HTML web editors when they make webpages and blogs. Thanks for accepting the answer
I just noticed that some web browsers show this character as minus others as something similar to an short underscore. So for some users it is obvious and other can't distinguish it from a minus sign.
I think it is because of the used charset, which AFAIK is a combo os OS settings and browser

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.