Failed to find Java VM - java

I've always used Google2SRT, a light software to download subtitles from Youtube. Now it no longer works: "Startup Error: Failed to find Java VM".
I have Java installed, I have Netbeans installed and working, I have never had any Java related issues.
I've tried reinstalling everything, I've tried creating a JAVA_HOME and JRE_HOME System variable and pointing it to "C:\Program Files\Java\jre1.8.0_191" according to this tutorial: https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html
It felt odd because I didn't even had this environment variable previously. I have no idea what's the issue.
I've tried uninstalling Netbeans and other programming tools as well.
I'm on Windows 7 x64.
java -debug -version > "%userprofile%\desktop\javaDebug.log" 2>&1 returns:
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
I have also tried setting maximum heap size in _JAVA_OPTIONS
System Variables

Just go to the install dir (e.g. C:\Program Files (x86)\Google2SRT), open a cmd.exe, cd to the above folder and type java -jar Google2SRT.jar. You don't need the .exe
This should work, provided you have java installed. Check by typing java -version in the cmd.

Related

jpackage command is not recognized

I am trying to package a jar file into an executable file using the jpackage tool in Java, but the command is not recognized in the command prompt using Windows 10 and Java version:
> java --version
java 17.0.1 2021-10-19 LTS
Java(TM) SE Runtime Environment (build 17.0.1+12-LTS-39)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.1+12-LTS-39, mixed mode, sharing)
I have the full JDK installed and the command javac is recognized.
I checked my computer with the "where java javac jpackage" command and it only found the first two in the CommonFiles folder.
I looked in the folder path "ProgramFiles\Java\jdk-17.0.1\jmods" and both the "jdk.jlink.jmod" and "jdk.jpackage.jmod" files are present.
Can someone please help me figure out why the tool isn't recognized by Windows?
I found the issue to be the way my Environment Variables were set up for Java. To fix my problem, I went into the JAVA_HOME variable and changed the entry from
C:\ProgramFiles\Java\jdk-17.0.1\lib
to
C:\ProgramFiles\Java\jdk-17.0.1
Next I updated the path variable to include "%JAVA_HOME%\bin". Before I had it listed as C:\ProgramFiles\Java\jdk-17.0.1\bin. Both of these changes were made under the System variables using the "Edit" button. I want to thank dave_thompson_085 for pointing me in the right direction.

How to use the latest Java SE version?

I had Java SE (version 8) installed on my computer (Windows 10). Now, I have downloaded version 13. I have also added the path
C:\Program Files\Java\jdk-13.0.1\bin
in Environment Variables -> System Variables -> Path
But still when I write
java -version
on cmd, I get the path of the older version.
java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)
Upon writing
where java
I got the following result
C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe
C:\ProgramData\Oracle\Java\javapath\java.exe
C:\Program Files\Java\jdk-13.0.1\bin\java.exe
In the environment variables ->
I get the following relevant paths:
C:\ProgramData\Oracle\Java\javapath
C:\Program Files\Java\jdk-13.0.1\bin
Note: doesn't have the path of Java 8 as I deleted it.
Interestingly, I am still able to run the Java code.
I am confused now..
Move C:\Program Files\Java\jdk-13.0.1\bin to the top in the list of environment variables. Then, open a new command prompt and execute java -version.
If you don’t explicitly add the directory to your PATH environment variable, you get the java binary installed at system level.
This was typically done by the browser java plugin installer, which is not used anymore so you get to keep the old version. I would suggest uninstalling it.

Uiautomatorviewer not finding JAVA_HOME

When I try to start uiautomatorviewer.bat i get this error:
ERROR: No suitable Java found. In order to properly use the Android Developer
Tools, you need a suitable version of Java JDK installed on your system.
We recommend that you install the JDK version of JavaSE, available here:
http://www.oracle.com/technetwork/java/javase/downloads
If you already have Java installed, you can define the JAVA_HOME environment
variable in Control Panel / System / Avanced System Settings to point to the
JDK folder.
You can find the complete Android SDK requirements here:
http://developer.android.com/sdk/requirements.html
I have a working JDK at C:\Program Files\Java\jdk-9
My system variables are:
JAVA_HOME C:\Program Files\Java\jdk-9
PATH C:\Program Files\Java\jdk-9\bin;D:\Prac\AndroidSDK\platform-tools\bin;D:\Prac\AndroidSDK\tools\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;%ANDROID_HOME%;%ANDROID_HOME%\build-tools\25.0.3;D:\Prac\nodejs\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;
( ANDROID_HOME D:\Prac\AndroidSDK )
My java version:
java version "9"
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)
echo %JAVA_HOME% is working OK (printing correct path).
I tried setting JAVA_HOME variable in the .bat script. That didn't work. (But that might be because I'm not sure where exactly in the script should I include it...)
Do you have any idea how to solve this?
Eureka! The problem was that I was using 64bit JDK.
After installation of 32bit version all I needed to do was to set ANDROID_SWT system variable and it is working now.

Java not found.Please make sure the system environment variable JAVA_HOME points to Java version 1.8 or higher

I am trying to install PingFederate but which alerts with Java not found.Java is installed properly please help me to install without issues.
Alert comes on PingFederate Installation:
Java not found.Please make sure the system environment variable JAVA_HOME points to Java version 1.8 or higher.
Commant prompt Java installation check:
PS C:\Users\S_TEST> java -version
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)
Environment Variables:
JAVA_HOME
C:\Program Files\Java\jdk1.8.0_101
PATH
C:\Program Files\Java\jdk1.8.0_101\bin;%SystemRoot%\system32;%SystemRoot%;
%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
How are you executing PF? Command-line or as a Service? If you are running via run.bat (command-line), then you'll need to exit your terminal shell after each change to JAVA_HOME. You can also try adding "\bin" to your JAVA_HOME setting per the instructions here --> https://documentation.pingidentity.com/pingfederate/pf82/index.shtml#gettingStartedGuide/task/installingJava.html
I think you might be running 32 bit executable of your software on 64 bit machine having 64 bit jdk installed.I had same issue with android studio and then I executed "studio64.exe" instead of "studio.exe".
You might need to look installation directory of your software (which you are installing) for a 64 executable.:))

Installing CPLEX on Mac: No Java virtual machine could be found

I try to install CPLEX on my Mac. When I open terminal and type
chmod +x /Users/MarjoleinKroon/Downloads/cplex_studio126.osx.bin
/Users/MarjoleinKroon/Downloads/cplex_studio126.osx.bin
I get the following error
Preparing to install...
Extracting the installation resources from the installer archive...
Configuring the installer for this system's environment...
/Users/MarjoleinKroon/Downloads/cplex_studio126.osx.bin: line 2374: Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java: No such file or directory
/Users/MarjoleinKroon/Downloads/cplex_studio126.osx.bin: line 2374: Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java: No such file or directory
No Java virtual machine could be found from your PATH
environment variable. You must install a VM prior to
running this program.
I searched the internet to solve this problem, and I found several things to check. If I type java -version I get
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
So it seems like java is installed properly. Furthermore, when I type /usr/libexec/java_home -V, a VM seems to be there:
Matching Java Virtual Machines (1):
1.8.0_40, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home
Online I read something about PATHs, but I have not enough knowledge to understand this exactly. However, if I type echo $PATH I get
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/texbin
I don't know what this means, but it seems kind of strange to me.
Can anyone help me? Please be as clear as possible, because I don't have a lot of knowledge concerning this. Thanks in advance!

Categories

Resources