David Prentiss
David Prentiss

Reputation: 548

Which version of Java supports the -command option?

I'm attempting to use spacemacs, elipse and eclimd for editing with autocompletion. However, eclimd is attempting to start the java server with the -command ping option. My version of Java does not support that option. I have been unable to find this option in the documentation. Is it deprecated? Which version of Java supports it?

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)

/usr/lib/jvm/java-8-oracle/bin/java -d64 -command ping -Dosgi.requiredJavaVersion=1.8 [email protected]/eclipse-workspace -XX:+UseG1GC -Dosgi.dataAreaRequiresExplicitInit=true -Xms256m -Xmx1024m -jar /snap/eclipse/current/plugins/org.eclipse.equinox.launcher_1.5.0.v20180512-1130.jar --launcher.suppressErrors -debug -clean -refresh -application org.eclim.application
Unrecognized option: -command
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Upvotes: 0

Views: 132

Answers (2)

GhostCat
GhostCat

Reputation: 140447

There is no -cmd.

But maybe you are talking about a new feature in Java 11. You can now do:

java HelloWorld.java

Meaning: when you have a "single file class", with a main method, you can sidestep invoking javac first, to then run java with the class name. Instead, you can do the above and directly "run+compile" a .java file.

That feature was added with JEP 330.

Upvotes: 0

OrangeDog
OrangeDog

Reputation: 38777

No version of Java supports -command.

That option is supposed to be an argument for eclim, not for java

eclim -command ping

or presumably something like

java -d64 -Dosgi.requiredJavaVersion=1.8 [email protected]/eclipse-workspace -XX:+UseG1GC -Dosgi.dataAreaRequiresExplicitInit=true -Xms256m -Xmx1024m -jar /snap/eclipse/current/plugins/org.eclipse.equinox.launcher_1.5.0.v20180512-1130.jar --launcher.suppressErrors -debug -clean -refresh -application org.eclim.application -command ping

Either you've configured something wrong, or something has a bug.

Upvotes: 2

Related Questions