Error occurred during initialization of VM - jvm

I'm getting the following error when running an executable I created on a 64-bit machine using C++ code:
"Error occurred during initialization of VM
Unable to load native library: Can't find dependent libraries"
My PATH (shown below) obviously points to jvm.dll since I have that file in both C:\Progra~1\Java\jdk1.6.0_17\jre\bin and C:\Windows\System32
PATH=C:\Program Files (x86)\Gmake\bin;C:\Program Files (x86)\apache-ant-1.7.1\bin;C:\Progra~1\Java\jdk1.6.0_17\bin;C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\Tools;C:\Progra~1\Java\jdk1.6.0_17\jre\bin\server;C:\Progra~1\Java\jdk1.6.0_17\jre\bin;C:\Windows\System32
Does anybody have any ideas as to what would cause this error? Thanks.

Use dependency walker to figure out what dll is missing.

I have the same issue when I run the java.exe in my Windows2008 R2 version.
my path was
PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32
\WindowsPowerShell\v1.0\;C:\Program Files\System Center Operations Manager 2007\
;C:\Java\jdk1.6.0_33\bin
when I run the java.exe under C:\Java\jdk1.6.0_33\bin, it works fine. I found that within the c:\Windows\System32\ comes with a copy of java.exe. When I run the c:\Windows\System32\java.exe, it shows the same error:
C:\>Windows\System32\java.exe
Error occurred during initialization of VM
Unable to load native library: Can't find dependent libraries
I fixed this issue by moving the C:\Java\jdk1.6.0_33\bin to the beginning of the PATH environment:
PATH=C:\Java\jdk1.6.0_33\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\
Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\System Center
Operations Manager 2007\
Hope this help.

This is how I solved a similar problem:
Used JavaRa: http://singularlabs.com/software/javara/ to remove old java versions.
Restarted the PC.
Re-installed the latest JDK version.

In my case, there was a jvm.dll file in the same folder as my exe file. I simply deleted the jvm.dll from there and it worked. Probably, it preceded the one in the PATH

I got this error as my PATH (environment variable) has not set correctly.
while setting PATH variable, set path of jvm.dll as a very first path in the list
Reboot your machine.
Note: Do not move jvm.dll to your project directory.

I had a complicated case. There was a jvm.dll file in the same folder as my exe file. I deleted it (because it shouldn't be there) but jvm.dll couldn't be find then.
I wanted to solve it by adding %JAVA_HOME%\jre\bin\server to my PATH because jvm.dll is located there. However, it didn't work. It turned out that the Windows loader won't expand the JAVA_HOME variable during searching for jvm.dll in the paths specified in PATH because I defined JAVA_HOME as user's variable. When I defined JAVA_HOME as a system variable, it started working as expected.

Related

impossible to install a intellij idea

I downloaded the ultimate version of IntelliJ from the official website and when I do ./idea.sh in the .. /bin directory of the file I get this error message in the terminal:
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.Error opening zip file or JAR manifest missing : /root/.jetbrains/jetbrains-agent-v3.2.0.de72.619 Error occurred during initialization of VM agent library failed to init: instrument
I don't know if I am supposed to have a .jetbrains file in my repersonel if so why I don't have it and if not how to get it?
Cordially...
What's the environment of your machine and I do not think you need to care about how to get .jetbrains manually by yourself. I've installed a IntelliJ idea on Ubuntu18.04, it works well. You can try run it as an administrative, also you can go to ./bin folder and then run ./idea.sh rather than ../bin folder
btw, as I said install, it does not indicate we need to compile it and get some executable binary file to run it. It's a green software that contains anything you need, you can run it directly
The Error opening zip file or JAR manifest missing : /root/.jetbrains/jetbrains-agent-v3.2.0.de72.619 error indicate that there is a problem with the distribution you have downloaded. It was corrupted or modified improperly.
Re-download it from https://www.jetbrains.com/idea/download and install into a new empty directory.
You can also try deleting the IDE's config and system directories.

Missing tools.jar when launching STS application

I have the latest STS4. I am using installed java-1.8 JDK not embedded as the execution environment. My project just runs fine without any issue.
However when I launch the STS application itself I have a pop up saying
"Missing tools.jar"
I have already tried:
pointing JAVA_HOME to different JDK
added -vm args in the .ini file.
Yet I cannot get rid of this pop up.
I solved this same problem by modifying the file "eclipse.ini". First I tried to solve it by modifying the file SpringToolSuite4.ini, but nothing happened, because I previusly had installed the eclipse ide, and the change in SpringToolSuite4.ini didn't work. then I modified the file eclipse.ini; and it worked.
The changes that I did in eclipse.ini are detailed below:
To check with what Java version (JRE or JDK) Eclipse is running, do the following:
Open the menu item Help > About Eclipse. (On the Mac, it’s in the Eclipse-menu, not the Help-menu)
Click on Installation Details.
Switch to the tab Configuration
Search for a line that starts with -vm. The line following it shows which Java binary is used.
Depending on the name and location of the used Java binary one can figure out if a JRE or a JDK is used:
If the path contains “jre” (e.g. as in C:\Program Files\Java\jre6\bin\client\jvm.dll) it is a JRE
If the path contains “jdk” (e.g. as in C:\Program Files\Java\jdk1.6.0_31\bin\javaw.exe) it is a JDK.
If no JDK is used for Eclipse, change it:
Quit Eclipse if it is running
Go to the Eclipse installation directory and open the file eclipse.ini in a text editor.
Search for the line -vmargs
Before the line -vmargs, add two lines:
On the first line, write -vm
On the second line, write the path to your JDK installation (usually something like: C:\Program Files\Java\jdk1.6.0_31\bin\javaw.exe on Windows)*
source: https://matsim.org/docs/devguide/eclipse/jdk
The fix is in the -vm parameter. the order and the absolute path of the javaw.exe seems to be the issue.
the readme file mentions _
"To run Eclipse with an alternate Java runtime environment, the path to the Java virtual machine's binary must be identified. With an Eclipse installation from the distribution, altering the $PATH variable to include the path to the alternate Java runtime environment is often not enough as the Eclipse that Linux distributions package often performs a scan internally to pick up GCJ by itself whilst ignoring what's on the $PATH."
So I have edited now the SpringToolSuite4.ini and made this entry
-vm
C:\UserTemp\Softwares\java\jdk\oracle-jdk-1.8-64bit\bin\javaw.exe
Restarted my STS and it works perfect.
The reference to set the JVM Specifying the JVM was very useful in understanding this.
Don't spend too much time looking for tools.jar. If you get an error like that, don't be upset.
If you already have java JDK1.8, go to its lib folder, tools.jar should be available there. Copy and paste the same in JRE1.8 lib folder.
I have STS4 so I have modified SpringToolSuite4.ini
I changed from:
[...]
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.8
[...]
to exactly this
[...]
--launcher.defaultAction
openFile
-vm
C:\Program Files\Java\jdk1.8.0_152\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.8
[...]
And the message dissapeared
SOLUTION :
Check your Path JAVA_HOME - system property "Environment Variables"
for example: JAVA_HOME:
C:\Program Files\Java\jdk-12.0.1\lib
usually you only need add \lib at JAVA_HOME
Just remove this line from variable "Path"
"C:\Program Files (x86)\Common Files\Oracle\Java\javapath"
System Properties > Advanced > Environment Variables > Path > Edit > Reboot
Worked for me
In my case I had installed jre, and not jdk!
Observe that you have jdk installed!
I had the same issue when i upgraded to Java 11.
I simply edited SpringToolSuite4.ini and added
-vm
C:\Program Files\Java\jdk-11.0.4\bin\javaw.exe
For me, I had to do two things to make it work:
Remove vmargs:
vmargs
Dosgi.requiredJavaVersion=1.8
Setting the JDK:
vm
C:\Program Files\Java\jdk1.8.0_131\bin
By downloading the tool file and paste it in the jre\lib path. but make sure you should rename the pasted file as "tools.jar".
step 1
download the tool file.
download link http://www.java2s.com/Code/Jar/t/Downloadtools160jar.htm
step 2
extract the zip file.
step 3
you should rename the included .jar file as "tools".
step 4
then copy the renamed tools.jar file and paste in the C:\Program Files\Java\jre8\lib\ path.
then restart the STS ide.
I have fixed this from Window->preferences->Java->Installed JREs .
Then add the jdk bin path, uncheck other related jre paths
Copy JDK directory to your STS installation or extraction library and and rename JDK to jre. the directory structure of STS should look like this
.eclipseproduct
artifacts.xml
configuration
dropins
eclipsec.exe
features
jre
license.txt
META-INF
open-source-licenses.txt
p2
plugins
readme
SpringToolSuite4.exe
SpringToolSuite4.ini
Once STS open, initially its looking for tools.jar in jre\lib folder its not available in jre\lib folder.
so we need copy the tools.jar from jdk\lib folder and paste in jre\lib folder.
restart the STS, issue will resolve.

CMake VTK_DIR-NOTFOUND

VTK_DIR-NOTFOUND is returned when using CMake. I am using CMake GUI and, as other path errors, I can point then to proper path. However, for VTK doesn't work. I am pointing to directory where VTConfig.cmake file and others are. Also tried with all of other VTK dirs but without any sucess. I am using Visual Studio 12 2013 Win 64 configuration for generation but tried with 2010 too.
pointing to path manually,
The first thing I would check is what is the actual find_package() command being invoked where the error occurs? Perhaps that call is something a bit unusual or explicitly has the MODULE keyword (this would prevent the VTKConfig.cmake file from being found).
If that looks okay, check to see if something is modifying the VTK_DIR variable. Insert the following near the top of your top-most CMakeLists.txt file:
variable_watch(VTK_DIR)
This should tell you what, if anything, is modifying it in ways you didn't expect.
Assuming VTK_DIR is not actually being changed, the next thing you could try is setting CMAKE_PREFIX_PATH to the directory containing the VTKConfig.cmake file (you can add this in the CMake GUI if it isn't there already). Maybe also try variable_watch(CMAKE_PREFIX_PATH) too just in case something is modifying that internally in unexpected was as well.
If that still doesn't reveal anything, then it would seem likely that there is something wrong with either your CMake or VTK installation. Perhaps try an earlier CMake version and see if you get any different behaviour.
Although the currently accepted answer is a good way of debugging, it looks like you're building Point Cloud Library (PCL) with the binaries from unancyowen. In which case I suggest ensuring your system environment variables are setup correctly which will automate the process you are currently going through and facilitate the job of the find_package() methods.
Assuming you installed everything in the same directory (i.e. where you have already linked to FLANN and Eigen) the following default PCL 3rd Party Libraries should be added to Path:
C:\Program Files\PCL 1.7.2\3rdParty\FLANN\bin
C:\Program Files\PCL 1.7.2\3rdParty\VTK\bin
C:\Program Files\PCL 1.7.2\3rdParty\Eigen
C:\Program Files\PCL 1.7.2\3rdParty\Boost
Then Qt, OpenNI etc. which are installed separately.
And you can also add:
BOOST_INCLUDEDIR : C:\Program Files\PCL 1.7.2\3rdParty\Boost\include\boost-X_XX\boost (Replace X_XX with your version number)
BOOST_LIBRARYDIR : C:\Program Files\PCL 1.7.2\3rdParty\Boost\lib
BOOST_ROOT : C:\Program Files\PCL 1.7.2\3rdParty\Boost
EIGEN_ROOT : C:\Program Files\PCL 1.7.2\3rdParty\Eigen
In the field where it is showing that
VTK - DIR : NOT FOUND
You can either copy paste the location or type in, or just browse for the file called VTKConfig.cmake. Generally found inside the build folder of VTK. This is how it solved in my case. Have a try!!

Windows 7 Registry for Java Runtime points to absent file

My java programs stopped working today after an upgrade and started giving error: Failed to load shared library, library name: C:\Program Files\Java\jre7\bin\client\jvm.dll
I checked and there is no 'client' directory at this location. There is a 'server' directory that has a jvm.dll.
There was no mention of this path in any configuration file and finally I ended up looking into registry and there under
JavaSoft/Java Runtime Environment/1.7 are four keys. Variable 'RuntimeLib' has this value.
Obviously the dll does not exist at this location. I have reinstalled JRE and again there is no file at this location.
I tried to rename the 'server' folder to 'client' filder but the program gave a different error. 'Unable to find the start class'. So Apparently the jvm in server folder is not the one expected in client folder.
It is a complete 64 bit environment.
Am I the only one who has seen this issue?
Does JRE install create a 'client' folder for you gurs on Windows 7?
Any suggestions?
Thanks

mono Newbie. Installed but env vars not set.. maybe things missing

I'm just installing mono to learn how it all works.
I installed mono (mono-2.10.9-gtksharp-2.12.11-win32-0.exe) for the first time and just started to follow on through the Mono Basics page to verify the installation.
http://www.mono-project.com/Mono_Basics
I was surprised that the installer didn't set up the PATH env variable , but once I'd done that I was able to get the first example compiling/running.
But I'm getting compile errors on the second example. So am wondering if I am missing further environment variables/settings?
Are the environment variables used by mono documented anywhere?
I'm also just wondering if the installer is ok or should I be looking for another one...
The error messages are as follows:
C:\Users\Vida\Desktop\Learning\Mono>gmcs hello.cs -pkg:gtk-sharp-2.0
error CS2001: Source file `Files' could not be found
error CS2001: Source file
`(x86)/Mono-2.10.9/lib/mono/gtk-sharp-2.0/pango-sharp.dll' could not
be found
error CS2001: Source file
`(x86)/Mono-2.10.9/lib/mono/gtk-sharp-2.0/atk-sharp.dll' could not
be found
error CS2001: Source file
`(x86)/Mono-2.10.9/lib/mono/gtk-sharp-2.0/gdk-sharp.dll' could not
be found
error CS2001: Source file
`(x86)/Mono-2.10.9/lib/mono/gtk-sharp-2.0/gtk-sharp.dll' could not
be found
error CS2001: Source file
`(x86)/Mono-2.10.9/lib/mono/gtk-sharp-2.0/glib-sharp.dll' could not
be found
Compilation failed: 6 error(s), 0 warnings
Sounds like some component is confused by the spaces in Program Files (x86) (which is presumably the installation directory.) Try setting the PATH using its short name (normally Progra~2) , or reinstall to a directory that doesn't have spaces. You can also try additionally setting the MONO_PATH environment variable.