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.
Related
I've recently installed and tried to use Grakn.ai for visualization. Following the instructions on grakn.ai's website, I ran into the following problem when trying to run:
\grakn-dist-0.15.0>.\bin\grakn.sh start
in Windows 10 command prompt, 64 bit, the following lines are displayed before exiting:
Starting redis
Cassandra already running
Starting engine.Error: Could not find or load main class
ai.grakn.engine.GraknEngineServer
Error: Could not find or load main class ai.grakn.client.Client
.Error: Could not find or load main class ai.grakn.client.Client
.Error: Could not find or load main class ai.grakn.client.Client
I have also attempted to add JAVA_HOME into System Variables, however this is to no avail. (I noticed that JAVA_HOME did not exist when I initially looked for it and so I had to manually create the variable and set jdk path - perhaps this implies some issue)
Thank you very much for your time and I'd be very grateful for any help.
You can start by checking the version of the jdk you are using. Grakn requires Oracle JDK 8 to be specific.
Also note, that Grakn does not yet officially support Windows because of Cassandra 2.1 being beta on windows. However you can get it working on windows. This page suggests how you can achieve it. I would recommend going with the docker version as it is simpler to work with.
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)
I can't seem to get this program to work, and I am at a loss for why.
When I type java in to "run" (Using windows 7), I get the message
"Windows could not find Java".
I also have installed java and re-installed it to no avail. I have a feeling the directory is messed up (probably because I butchered it when I changed the boot drive to my SSD, and used my old hard drive as an internal storage drive).
your windows PATH for java is probably the problem.
when you type in java in to the run screen...windows locates the version of java defined by the path.
1) try typing java -version
if that doesn't work windows can't find the java installation.
2) try finding the java exciutable where you install java and trying running that directly
if that works its a path problem
Am getting the following error message while trying to run java. I have typed in java -version but am getting error:
C:\>java -version
Picked up _JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:C:\PROGRA~1\HP\QUICKT~1\
bin\JAVA_S~1\classes;C:\PROGRA~1\HP\QUICKT~1\bin\JAVA_S~1\classes\jasmine.jar
Error occurred during initialization of VM
Could not find agent library jvmhook on the library path, with error: Can't find
dependent libraries
Java is being invoked in a slightly abnormal way.
I have multiple answers depending on your Java version number and whether or not you wish to perform automated testing on your computer.
HP's Quick Test Professional (QTP, an automation tool) has been installed on your computer; this is the program which creates _JAVA_OPTIONS (and usually also IBM_JAVA_OPTIONS) to be what you observed in your post:
-Xrunjvmhook -Xbootclasspath/a:C:\PROGRA~1\HP\QUICKT~1\
bin\JAVA_S~1\classes;C:\PROGRA~1\HP\QUICKT~1\bin\JAVA_S~1\classes\jasmine.jar
QTP puts these in place so that it can recognize Java objects, allowing you test a Java application.
It also can create environment variable
JAVA_TOOL_OPTIONS with
-agentlib:jvmhook
which is required for working with Java 1.6
If you do not require QTP to perform tests against Java applications then you can experiment with removing these environment variables.
Pro-tip for easy reverting, just amend the Environment Variable names (e.g. rename _JAVA_OPTIONS to IGNOREME_JAVA_OPTIONS)
*Environment variables require local admin privileges and a system restart to take affect.
If you are using Java version 1.5 or older then you can probably get away with removing JAVA_TOOL_OPTIONS only.
The jasmine.jar seems to be troublesome to a number of java applications; I have had considerable difficulty with this stopping my applications from running in the past.
The _JAVA_OPTIONS environment variable is making some very serious modifications to your Java environment -- and obviously doing it wrong, since it's not launching. I don't know what is setting that environment variable, but if it's not something you're trying to do yourself, if I were you I'd make a note of the value just in case you need to restore it, then go to your Windows "System" Control Panel and remove _JAVA_OPTIONS altogether.
I'm using Intellij IDE. Removing .idea folder from project's local directory solved this issue.
Problem: java.exe complains about dll
We use a tool that copies-and-renames java.exe to a temp directory, i.e. /path/to/some/dir/java_foo_application.exe. [The tool is 'Yet Another Java Service Wrapper' or YAJSW. It copies-and-renames so that meaningful names show in the windows task manager ]
On some machines, corrupt java entries in the windows registry give this error when running this copied java.exe:
Error opening registry key 'Software\JavaSoft\Java Runtime Environment'
Error: could not find java.dll
Error: could not find Java SE Runtime Environment.
Solved Once Before: Uninstall and reinstall
I've had this problem once before: nd solved it by uninstalling all jdk's -- using windows "add remove programs"-- and reinstalling a newer version of java.
Note that one of the jdk's would not uninstall. I had to download special registry cleaner from microsoft to force uninstallation.
My question: Detect and Prevent?
How can one tell in advance whether a system has corrupt java registry entries?
How to prevent this corruption for the future?
Any other ways to fix this aside from uninstalling and reinstalling the jdk's?
Thanks.
To find out what the real problem, download two jar files:
first and second
remember to set:
wrapper.console.pipestreams = true
Described on this page
The Wrapper log file shows me this trace:
-set state RESTART_START->RUNNING
-Registry key 'Software\JavaSoft\Java Runtime Environment\CurrentVersion'
has value '1.5', but '1.6' is required.
-Error: could not find java.dll
-Error: could not find Java 2 Runtime Environment.
process terminated
Controller State: WAITING -> PROCESS_KILLED
I solve my problem reinstalling System JRE 1.6.
Best regards!
Instead of messing with javaw you could use an executable wrapper to start your application. See for example exe4j or JSmooth.