sony@sony-VPCEH25EN:~$ java --version
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
Unrecognized option: --version
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Solution:
Remove extra hyphen '-'
sony@sony-VPCEH25EN:~$ java -version
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
Press Windows+Pause keys simultaneously to open the "System" window. You can alternatively open the control panel manual to go there if you prefer it that way.
Click on "Advanced system settings" on the left then click "Advanced" tab.
If none of the other options works, then this could be an issue with the version of the JDK itself, just uninstall the current jdk and install the latest version.
I also faced this issue. After trying everything, I upgraded to the latest JDK and this issue was resolved on its own.
I had the same issue today when running the ancient software Dundjinni, a mapping tool, on Windows 10. (Dundjinni requires a rather old installation of Java; I haven’t tried updating Java, for fear the programme will fail.) My method was to simply run Dundjinni in administrator mode. Here is how:
Click Start or press the Start key, navigate down to the software, rightclick the programme, choose More, then choose Run as administrator. Note that this option is not available if you simply type the name of the software.
You just need to add JAVA_HOME to your environment variable. Just point this variable to jdk location(not the jdk bin location) as shown in the below image.