Java executable javaw.exe, Error: Could not create Java virtual Machine - jvm

I am trying to install some commercial software that was written in Java for a Windows computer operating system. I have downloaded Java from their site and I have also downloaded the JDK package for a 64bit windows system so to my knowledge I should have everything I need to have java work. I then create a shortcut of the java exectuable javaw.exe and edit the target path and the start in path to my specifications but when I go to execute it, it tells me that it "Could not create Java virtual machine".
Does anyone know how to fix this error?
Luke H

How are you creating the shortcut? In windows, this might not be the correct approach.
Does the installer use an embedded version of java? It is possible that the software uses some native libraries that aren't compatible with 64 bit java.
Depending on the setup script, it may be passing invalid command line arguments to the version of Java you installed.

Its a bit late, but this might help others later.
Here's what worked for me:
Target: "C:\Program Files\Java\jre1.7.0\bin\javaw.exe" -classpath C:\OLINDA olinda
Start in: C:\OLINDA

It seems that you don't know how properly start the Java Virtual Machine, in Windows, the JVM can be started with two executables one is java.exe and the other one is javaw.exe, both do the same, the only difference is that java.exe is a command line tool (so you'll see a command line when you start your application) and javaw.exe simply omits the command line. Both use the same paramaters that can be found here: http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/java.html, from this the shorter way to open a Java program will be:
java MainJavaClass.class
or
java -jar JavaProgram.jar
Most commercial programs are packed in jar files so probably you will use the second approach, but also be warned that usually commercial Java programs use a native wrapper so you can simply launch a native application (in Windows .exe), without the need to set anything, so you may need to create a shortcut for it instead of the java.exe program, in the case you really need to call the Java program through the JVM, then what you need to change is the Target field so you include the parameters you need to pass to it like this:
"C:\Program Files\Java\jre7\bin\java.exe -jar JavaProgram.jar"
Another way could be use a batch file to start the program and create a link to it instead.

Related

Lua SDK for IntelliJ on a Linux system?

Trying to set up IntelliJ IDEA with the Lua plugin. This requires me to direct it to the location of a Lua SDK. All instructions I have been able to find for this are on a Windows system, pointing to a specific directory in Program Files. I am running a Linux system. I've built and installed Lua 5.3.4 (newest version at time of writing) from source, but as far as I can tell that doesn't include any equivalent to the SDK needed – it just drops a variety of necessary files in /usr/local/{bin,include,lib,man/man1} and creates two empty directories /usr/local/{lib,share}/lua/5.3.
Am I missing something conceptual? Do I need to get something else (the existence of which I have been unable to confirm)? Should I just give up on this and find another IDE? The plugin seems to come with two SDKs, Kahlua and LuaJ, but I don't know how well either of these match up to either standard Lua or LuaJit, which are what I would be using.
This is assuming you are using this Lua plugin for IntelliJ:
If you have installed Lua via DNF or yum simply guide IntelliJ to /urs/bin and it'll find it. (I assume this also works for other installers like apt or brew.)
It looks like the SDK is just looking for two files lua and luac which both live in /usr/bin.

For package.loadlib does lua require the dll to be COFF format or ELF format?

I'm trying to load a dll into my lua script and call the function. When I create the dll using GCC (under cygwin) and lua (5.2.4) I'm able to load the library & execute it without a problem.
However, when I create run the same script from SciTE, using Lua 5.1, the dll loads successfully. However, it does not execute. In the dll I'm trying to simply write two integers into a file.
t = package.loadlib("mylibrary.dll","myfunc")
t(23,45)
There are two questions here:
1. What format should the 'mylibrary.dll' be, for lua to understand and execute without problems - ELF or COFF.
2. Can I run dll (built under windows, obviously) under lua running on linux?
The question in your title seems to be very different from the cause of the problem you describe.
On the one hand, the format for dynamic libraries loaded by Lua is the format for the platform that the Lua code is running on. Just as you can't take a compiled Win32 executable and expect it to run on Linux, you can't take a compiled Win32 dll and expect it to load it on Linux. Obviously emulation tools like Wine exist, but those work by emulating Windows. You could run them within the emulator, but not outside of it.
But on the other hand, that is not the source of your problem. Your problem is that you're using a dynamic library that was built for one version of Lua with an application that was built for another version of Lua. That doesn't work; Lua does not retain compatibility between "minor" versions, only between revisions (Lua 5.1.3 vs. 5.1.4).
ELF or COFF, that isn't going to work.

Two JVMs and setting the environment variable having issues

I am working on two projects one uses JDK 8 and other uses JDK 6.
I installed both the jdks in my machine where JDK8 is set as my default JVM. so I am good with one project settings.
When I am working on second project, I tried to change JAVA_HOME to C:\Program Files\Java\jdk1.6.0_45 and PATH added with C:\Program Files\Java\jdk1.6.0_45\bin and surprisingly I am seeing JDK8 as my default JVM. I checked with java -version or java -fullversion.
Questions.
Where should I stop the Java process that is initiated with JDK8 ?
Where should I start the Java process for JDK6 ?
How should I easily switch JVMs when I switch back and forth working on two projects ?
I dont like the idea of uninstalling one jvm when I have to work with another jvm.
Please suggest me. Thanks for your time.
Narayana.V
When you run a program in your shell, it is the PATH environment variable which determines which program is run. This is a feature of DOS prompt and unix shells and not specific to Java. If you want to change the program which is run by default, you need to change the PATH.

Can't uninstall GlassFish 3

Okay, so here is the deal:
I was trying to install the java jdk so i can work on an android project in eclipse on this computer, but there are just so many different installations of java its impossible, for me atleast, to figure out exactly which one i needed. so i went with "JDK 7u3 with Java EE". But this also installed this GlassFish stuff, which i have no idea what is or what it does, and when i was going through all the eclipse stuff i decided to just keep my other computer for work. so i removed eclipsed and the stuff needed for that, and i removed the java stuff, but then when i try to uninstall the GlassFish, it can't, and gives me the error:
"Could not find the required version of the Java(TM) 2 Runtime Environment in '(null)'."
I have now been trying for several hours, scouring the web to figure out some way of removing this, install all kinds of java stuff, removing it again, reinstalling, but nothing works. I don't really care what GlassFish is or what it does, i just want it, and all the java stuff gone for good.
How can i accomplish this?
under Microsoft Windows 7 (or others), use that command line :
uninstall.exe -j "%JAVA_HOME%"
You installed first jdk1.6 then uninstalled it. In this time, you install glassfish3 and glassfish wrote set AS_JAVA=C:\Program Files (x86)\Java\jdk1.6.0_x in its config file but you use now jdk1.7
Open C:\glassfishv3\glassfish\config\asenv.bat
Search 'set AS_JAVA'
Change its value to your current jdk path ( eg. C:\Progra¨1\Java\jdk1.7.xx )
Try to uninstall again.
You can run the uninstall specifying the jvm to use:
try this following command to uninstall
C:\glassfish3\uninstall.exe -j <java home dir>
as stated in the error message. it worked for me.
GlassFish is a Java EE application server developed in open source, so you can create server-side services that your android apps can consume. Of course, is sounds like you are not really interested in this :-)
The Java EE SDK install/uninstall instructions are here: http://java.sun.com/javaee/sdk/javaee6sdk_install.jsp
What you probably want to download, the Java 7 SDK (JDK 7) is here: http://www.oracle.com/technetwork/java/javase/downloads/index.html
Make sure you download the JDK (Java Developer Kit) and not the JRE (Java Runtime Environment).
Hope this helps.
These didn't work for me running java 1.6.0_24 in Windows 7:
I tried modifying the asenv.bat file that glassfish uses to find the jre to point to my jre.
I tried manually putting it in as in C:\glassfish3\uninstall.exe -j . This was per the official Oracle documentation.
The only thing that worked was to use the original path and move the bin and lib folders from my java installation to the directory that the error dialog
specified. Then the Glassfish uninstall started up and completed with no problems.
I was able to uninstall the glasshfish server by using the below command
uninstall.exe -javahome "%JAVA_HOME%"
Note: We need to set the JAVA_HOME in the environment variable and classpath variable

Single Executable file

How to make single executable file ( not installation file) that run on every windows 7 . without needing any type of specific framework or platform .
For example if i make c# application and try to run on another system, it require dot net framework. How can i get rid of this problem.
Which Language or IDE i use to make independent executable file.
I don't know if it is exactly what you want,
but why not just write a c application that only makes use of Windows API and compile this one into an executable file?
IDE's compile it for you and you can run this *.exe on any computer you want.