How to fix could not create java virtual machine? - java

I'm trying to install Java so I can allocate more RAM towards the technic Minecraft launcher. I had an older version of Java so I decided to uninstall that one and install a new one. After doing so I get this error:
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occured. Program will exit.
I looked all over the web for answers and only came up with older solutions that involved going into environmental setting in the control panel however those didn't work. I would really appreciate some help with this.

Related

How to update Open Java 17 on my linux machine -- need to

I've dabbled with Linux in the past, but my MB pro is dying -- started yesterday, in fact -- and it's time to switch. I have experience with the command line in the Terminal app, so most of the commands -- at least the basic ones -- I'm familiar with in Linux.
I 'm running elementary OS, and was able to download and install the Open JDK for Java 17. I'm working on a project as a way of learning Java. I have a folder labeled "Contacts Java Classes", and I know how to get to the folder, etc. There's a file that I want to run which contains the main method to get things going -- 'MainWIndow.java'
I can compile the file. Before when I tried to run the file w/o compiling I got this error:
Error: LinkageError occurred while loading main class MainWindow
java.lang.UnsupportedClassVersionError: MainWindow has been compiled by a more recent version of the Java Runtime (class file version 62.0), this version of the Java Runtime only recognizes class file versions up to 61.0
After compiling the file, and trying to run it I get this:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-17-openjdk-amd64/lib/libawt_xawt.so
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2393)
at java.base/java.lang.Runtime.load0(Runtime.java:755)
at java.base/java.lang.System.load(System.java:1953)
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:388)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:232)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:174)
at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:315)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:285)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2398)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:818)
at java.base/java.lang.System.loadLibrary(System.java:1989)
at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:1392)
at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:1390)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
at java.desktop/java.awt.Toolkit.loadLibraries(Toolkit.java:1389)
at java.desktop/java.awt.Toolkit.initStatic(Toolkit.java:1427)
at java.desktop/java.awt.Toolkit.<clinit>(Toolkit.java:1401)
at java.desktop/java.awt.Component.<clinit>(Component.java:624)
at MainWindow.<init>(MainWindow.java:10)
at MainWindow.main(MainWindow.java:52)
Everything works fine on my MB Pro. But even thought I've dabbled before in Linux -- and I just mean dabble, since I always had my OS X -- I'm not sure what's going on.
Should I upgrade to Java 18? And if so, what's the best way to do it? Can anyone help me out? I'v been on other forums, but I'm not sure what I need to sak, and I think I may have gotten under some people's skin. The installing on OS X is easy, but it's more complicated here in Linux, and I'm not sure where to go.
I currently have the open JDK version, but there are versions on Oracle's site (Are they the same thing?). I tried downloading and installing them once last December, but I wasn't sure how to proceed, which versions I needed, and it was somewhat confusing trying to find the answers on the web.
Please offer me any assistance if you can. I wish to stress that my knowledge of Linux is very slight at this point, and I just want to get Java going on it, while I learn more about Linux. Does that make sense?

Error: Could not find or load main class: running compiled JAR different errors depending on how I run it

PREFACE! I know similar questions have been asked a million times. I have read MANY hundreds of the previous questions and still cannot find my answer.
I am working on a raspberry pi and trying to run a Java application that is packaged in a Jar file. It was working fine before I installed the latest Java 1.8_111. I downgraded and it still didn't work. I then wiped my pi to defaults and it is still not working.
The current Java version is 1.8.0_65. I have decided that the java version is irrelevant by installing multiple different versions with the same result. When I installed a different version no other version was present to cause conflicts.
If I run the jar by simply doing java -jar KitchenScr.jar I get the following error:
Error: Could not find or load main class com.javafx.main.Main
If I run the jar from the supplied shell script(below). I get the following error.
Script
#!/bin/sh
DIRNAME=`dirname $0`
CP=$DIRNAME/KitchenScr.jar
# start uniCenta oPOS
java -cp $CP uk.chromis.kitchenscr.KitchenScr
Error
Error: Could not find or load main class uk.chromis.kitchenscr.KitchenScr
If I left anything out please let me know.
This was a simple issue that was staring me in the face.
Error: Could not find or load main class com.javafx.main.Main
Oracle stopped releasing JavaFX for ARM around Update 30 or something. It worked initially when I first bought my pi, but not after I installed a new OS because a newer version of Java was running.
Downgrade Java or add relevent ARM libraries for JavaFX.
mine worked. CP=$DIRNAME/KitchenScr.jar, I changed the capital letters of kitchenscr.jar to CP=$DIRNAME/kitchenscr.jar

Java Virtual Machine Launcher- a java exception has occurred - debug

I received an error when trying to run HP's Operations Orchestration Studio for the first time.
The error in question states "Java Virtual Machine Launcher, a java exception has occurred". Having raised a ticket with HP, they suggest this is a java problem rather than a problem with OO studio.
I have seen similar errors to this with Eclipse posted in forums and the solution being to delete the .metadata folder, unfortunately OO doesn't appear to have such a file.
I have also tried removing all versions of Java installed on my Windows 7 64-bit machine and tried installing different 64-bit and 32-bit versions of Java which no success.
Does anyone know a way I could debug this error in order to resolve it?
Any help is much appreciated.

Java Error- Java Could Not Load the Java Virtual Machine

I was typing a program and this error occured:
BlueJ was unable to create a Java Virtual Machine(VM) to execute projects.This is a serious problem-you will not be able to create objects or execute methods till it is fixed.
I have tried uninstalling and reinstalling BlueJ.How do I fix this?
As the FAQ of BlueJ suggests you probably dont java JDK installed.
First go get it from here
(or directly from here if you want the latest version which I recommend to you).
If the problem still exists after the installation you probably have to set/ create the environment variable JAVA_HOME and include it to your environment variable PATH. You will be able to find a broad spectrum on how to do this by searching it on google.

java vm initialization error

I recently installed jdk-7u11 for Windows 64-bit. It worked well initially and I successfully compiled and executed my java programs using javac and java. But off late, once I compile a file using javac, it happens smoothly and when I proceed for execution of the file using java, it gives the following error :
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
What should I do? I am novice user of jdk and I also tried reinstalling the system after uninstalling it, but that didn't work. What is the solution? Thanks in advance.
It's probably due to misconfiguration of PATH and JAVA_HOME. The the java binary and JAVA_HOME should point to the same version of java. Otherwise bad things might happen
Sometimes attempts to load JDBC drivers perform dynamic class load attempts (i.e. reflection based)

Categories

Resources