Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unrecognized option: - Could not create the Java virtual machine

Tags:

java

linux

jvm

I am trying to run my .jar file on a linux server.

These are the commands I'm running:

JAVA_HOME=/app/local/opt/jdk/packages/jdk1.6.0_30/ 
export PATH=$JAVA_HOME/bin:$PATH 

cd folder
nohup java -jar program.jar &

When ran on Friday, this was working perfectly. However, today I am getting:

  Unrecognised option: - Could not create the Java virtual machine.

In my nohup.out

If I run java -v after setting the path I get the same problem. Can anyone suggest anything? Really confused about this.

Thanks for any help on this.

like image 777
Programatt Avatar asked Sep 30 '13 08:09

Programatt


People also ask

Can't create Java Virtual Machine A fatal exception has occurred eclipse?

At 'java Properties" window select the Compatibility tab and below the Settings pane, check the box Run this program as an administrator. Then click Apply and OK. 5. Finally, start the program that cannot run because of the "Could Not Create the Java Virtual Machine" error and see if the problem persists.

What is virtual machine error in Java?

public abstract class VirtualMachineError extends Error. Thrown to indicate that the Java Virtual Machine is broken or has run out of resources necessary for it to continue operating.

Could not find a valid Java Virtual Machine to load you may need to reinstall a supported Java Virtual Machine?

“Could not find a valid Java virtual machine to load. You may need to reinstall a supported Java virtual machine.” To fix, you need to insert the Java JRE bin folder location in to the Path system environment variable.


1 Answers

Usually, when we get this kind of exception ("Unrecognised option" which causes the "Could not create the Java virtual machine"), the JVM displays the unrecognized option, like this:

Unrecognised option: -[option details] Could not create the Java virtual machine.

the fact that you have no details makes it seem as though you just have a space (" ") in your command.

Take a look again to make sure.

like image 59
orirab Avatar answered Sep 23 '22 23:09

orirab