After installing Java 8 JDK on my Windows build server, I'm running into the following error when executing the sencha command:
C:\> sencha
Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'
has value '1.8', but '1.7' is required.
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.
The Sencha Cmd Guide implies that Java 8 isn't supported yet (however Sencha Cmd works fine on my Mac OS X workstation with Java 8):
Sencha Cmd requires Java Runtime Environment version 1.7 to support
all functionality...
I've still got JDK 7 installed on the server. Is there any way to force Sencha Cmd to use a different JDK install? Changing JAVA_HOME and PATH sysenvs does not work, and editing the registry isn't an option.
UPDATE: I've run across this question where multiple java.exe files cause the same error (and that's definitely a possibility here) however maven, ant, tomcat, jenkins, and a slew of other Java tools are working fine. I've only seen this error with Sencha Cmd.
To make this slightly more concrete, I followed ben's advice and created the following sencha.bat file in my installation directory:
#echo off
set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_75
set PATH=%JAVA_HOME%\bin;%PATH%
set SENCHA_HOME=%~dp0
java -jar "%SENCHA_HOME%\sencha.jar" %*
and I renamed the existing sencha.exe to something innocuous. Now I can simply type "sencha" at the command line without extra fuss. Of course, if you have a different minor version of Java 7, you'll need to edit the JAVA_HOME above.
My 'Path' environment variable are mapping 'C:\ProgramData\Oracle\Java\javapath' which contains 3 shortcuts for following files from 'C:\Program Files\Java\jre1.8.0_xx\bin':
java.exe
javaw.exe
javaws.exe
But these files are also present in 'C:\Windows\System32'; if you call 'java' from this directory you will have the same error (Error: Registry key...)
By replacing these 3 files in 'C:\Windows\System32' by the one's from 'C:\Program Files\Java\jre1.8.0_xx\bin'; it will solve the issue.
Try the following workaround to use the latest SenchaCMD working with JDK8:
check your PATH environment variable; especially the correct java installation path(s)
open the command prompt and go to the sencha-cmd folder
to use SenchaCMD just execute the "sencha.jar"-file with java:
java -jar sencha.jar
Now, you should see all version informations about the executed SenchaCMD-Tool.
Tested with JDK 1.8.0u25 and SenchaCMD 5.1.0.26 on W7 Prof. x64
I had this exact same thing, found that I was required to update the sencha cmd itself. I had extjs 5.1 cmd 5.1.0 , downloaded extjs 6.0.1 and tried to sencha app upgrade {new_extjs6_path} my app. Received the above error, figured out I was required to update cmd to 6.0.1 as well.
Related
I am trying to download android studio but it keeps telling me that i need to update or install Java, which i have done so afew times. But it keeps giving me the Java error message. I am running this on MacOS Mojave version 10.14.5. This is what the error keeps saying:
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
Make sure to install the latest JDK 12 from below link
https://www.oracle.com/technetwork/java/javase/downloads/jdk12-downloads-5295953.html
Configure the JVM and verify with command "java -version"
If above tasks has completed, retry the installation process.#naj
Set the JAVA_HOME Variable
Windows: configure java_home guide
Mac: configure java home guide
To verify whether you have install JAVA correctly or not in your machine. Do like below :
Open Command Prompt and Type : java -version
If it shows you the version then it all correct. But, if it does not recognize the command then you need to paste your jdk path in Environment variables. i.e : C:\Program Files\Java\jdk1.8.0_181\bin
I'm trying to make a cross-platform JavaFX application, and it works fine on Windows and OSX machines, but not on Linux.
When I try to run it on a Linux machine using java -jar app.jar, this is what I get:
Error: Could not find or load main class app.Main
But the class app.Main is in the .jar, as shown by 'jar tf app.jar':
...
app/Main.class
...
I tried specifying the main class using java -cp app.jar app.Main but I got the same error message.
The .jar was built in Intellij IDEA, using basic JavaFX configuration.
Any help?
So, turns out the problem was that the JRE on the Linux machine was OpenJDK, which does not come with JavaFX, as noted by James_D and jewelsea
After installing the oracle JRE 8, it worked fine
Sorry for the necro post, but I had to take a few extra steps. I had JRE 8 installed, but I still had to point java_home to it.
I'm using a MAC.
The JDK locations are here:
/Library/Java/JavaVirtualMachines (verify this)
The default JDK for my machine was temurin-17.jdk
I had to change it to jdk1.8.0_301.jdk
Steps:
Open a terminal
Type:
vim ~/.bash_profile
I pasted this onto the file:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_301.jdk/Contents/Home
Save and exit vim:
https://phoenixnap.com/kb/how-to-vim-save-quit-exit
In the terminal, type:
source ~/.bash_profile
Restart your terminal
In the terminal, type:
java -version
Make sure it's pointing to the right version
Now navigate back to where the .jar is located.
In the terminal, type:
java -jar myapp.jar
Hope this helps.
I have made a new Ionic / Cordova project and I'm trying to build it on windows 8.1. I installed JDK and JRE 7 as well as android sdk and ant and added them to my path using the following instructions.
cordova platform add android not working while listing Android targets
When I execute ionic platform add android or cordova I am still getting the following error:
C:\Users\BogdanR\.cordova\lib\android\cordova\3.4.0\bin\node_modules\q\q.js:126
throw e;
^
Error: Failed to run 'java -version', make sure your java environment is set up
including JDK and JRE.
Your JAVA_HOME variable is C:\Program Files\Java\jdk1.7.0_51
Error: Command failed: 'java' is not recognized as an internal or external command,
operable program or batch file.
at C:\Users\BogdanR\.cordova\lib\android\cordova\3.4.0\bin\lib\check_reqs.js:62:22
at ChildProcess.exithandler (child_process.js:641:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Socket.<anonymous> (child_process.js:956:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
Error: cmd: Command failed with exit code 8
at ChildProcess.whenDone (C:\nodist\bin\node_modules\cordova\src\superspawn.js:112:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
Unable to add platform android. Please see console for more info.
I tried modifying both system variables and user PATH variables.
THE WEIRD THING is that I can type in java -version and it works:
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
I am using nodist to manage npm if that is of any relevance.
After I ran into the same issue, the following steps seems to have fixed it:
PATH needs to contain the bin folder of the Java installation path C:\Program Files\Java\jdk1.8.0_05\bin make sure the bin is included
JAVA_HOME needs to be set to the root of that Java installation folder, in my case C:\Program Files\Java\jdk1.8.0_05
In my case, i had multiple java instalations, and whenever i tried to print "echo %java_home%" command on command prompt, it always used to return "%java_home%" as it is.
So i uninstalled all the java versions and then installed it again, and whoola, it worked.
Hope this helps someone.
There is one thing you can try is to set this variable JAVA_HOME to C:\Program Files\Java\jdk1.7.0_51\bin
Since you are using Windows, you can go to Control Panel to update it.
You were able to run java -version probably because it's included in the User's path.
In my case, It said "JAVA_HOME variable is unvalid, C:\Program Files\Java\jdk1.7.0_51".
Then I added a quotation mark to JAVA_HOME. Just like "C:\Program Files\Java\jdk1.7.0_51". Finally It works. May This can be helpful
There was a bad entry in the path that corrupted my whole system path.
C:\Program Files\Microsoft SQL Server\110\Tools\Binn";C:\Program Files\Microsoft\Web Platform Installer\;
Seems like that quotation mark is an entry added by SQL Server installation or web platform. I never added those to the path so it might be the installers fault?
I have researched this and none of the solutions that I have seen have fixed my error.
What is happening is I tried to install Java EE version got the above error and then found out that I must install Java SE first. So I installed Java SE and set the JAVA_HOME variable to C:\Program Files\Java\jdk1.8.0 which is where I installed my JDK. I also put C:\Program Files\Java\jdk1.8.0\bin in my PATH variable. Still not working. I also tried the JAVA_HOME variable with C:\Program Files\Java\jdk1.8.0\bin and that didn't work. I also tried installing without the PATH variable being updated to where I put my JDK.
I'm really getting confused as to why this is happening. I've had Java before and I don't recall having this much trouble installing it.
PS I don't install from the command line I just click the download icon in Firefox and then click the download.
Try running the installer at your commandline and pass the path of the JRE instead of the JDK.
For Example:
java_ee_sdk7-windows.exe -j "C:\Program Files\Java\jre8"
I had the exact same problem and even downloading the version without JDK didn't help!
I simply installed it from the terminal with passing the JRE For Example:
java_ee_sdk7-windows.exe -j "C:\Program Files\Java\jre7"
and it worked like a charm!
I had the same problem but an additional step was required in order to install using the command line. In the command window (on my Windows 10 laptop) I had to use:
cmd /d
to tell the cmd window to ignore registry AutoRun commands before the java installation executable would run. After using cmd /d, and changing to the directory where the .exe file was at, the following worked:
java_ee_sdk-6u4-jdk7-windows-x64.exe -j "%JAVA_HOME%"
Where JAVA_HOME is a system environment variable pointing to an existing JDK installation (C:\Program Files\Java\jdk1.8.0_65).
Uninstall everything, all of it.
Then go to your Program Files folder (and (x86) folder if on a 64bit Windows) and physically remove any Java folders.
Reinstall Java SE and then the EE packages. Sometimes Windows appears to get a bit confused and you need to help it figure out what to do.
If you want to uninstall, go to the glassfish folder and open the command prompt, then type:
uninstall.exe -j <The path to your JRE>
These points may be helpful.
java EE SDK7 contains glassfish v4.0 and it compatible with JDK6 and JDK7.
java EE SDK8 contains glassfish v5.0, it compatible with only JDK7 and JDK8, not JDK 9 or beyond.
So environment variable JAVA_HOME has to point to the root directory of one of the mentioned JDK. and %JAVA_HOME%\bin should be added to environment variable path
Despite having followed all of the above, setup of java EE SDK7 gets error:
could not find the required version of the Java(TM;
as Bakudan and laf8 said,
open cmd using run, with /d /a options as followed.
cmd /d /a
and next run SDK7-setup with -j option like this command
sdk7.exe -j "%JAVA_HOME%"
note that %JAVA_HOME% enclosed BY ""
This was happening to me when I tried to run the Java EE installer. What I did, was to download from Oracle a Java EE version which didn't include the JDK, because it was already installed in my system. Problem solved!
Open regedit.
goto :HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment\
set CurrentVersion to desired JDK version.
Check JavaHome and RuntimeLib path's for selected jdk version folder
Check JavaHome and RuntimeLib path's for selected jdk version folder
example: "HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment\1.7".
example:
JavaHome=C:\Program Files (x86)\Java\jdk1.7.0_79
RuntimeLib=C:\Program Files (x86)\Java\jdk1.7.0_79\jre\bin\server\jvm.dll
Source: http://tech-read.com/2009/05/19/how-to-solve-error-could-not-find-java-runtime-2-environment-while-opening-an-ide/
I'm trying to install Java to use Eclipse (I followed all instructions to install Java and Eclipse) but my Eclipse is not starting due to some bad configuration I guess. I can't figure out why it's not working for me.
Eclipse Installation:
Extracted Eclipse at C:\eclipse
Created a shortcut to my desktop having target C:\eclipse\eclipse.exe
When I try to run Eclipse with this shortcut, I see following Eclipse splash screen for a second and it disappears. Eclipse does not start at all.
JAVA Installation:
Installed JDK at C:\Program Files\Java\jdk1.7.0_10
Installed JRE at C:\Program Files\Java\jre7
Environment Variables Configuration:
JAVA_HOME = C:\Program Files\Java\jdk1.7.0_10
PATH = C:\Program Files\Java\jdk1.7.0_10\bin;
I tested my Java installation using the console and figured out this issue but I don't know how to fix it, and I guess this is causing Eclipse not to start.
Problem:
Go to Eclipse folder, locate eclipse.ini file, add following entry (before -vmargs if present):
-vm
C:\Program Files\Java\jdk1.7.0_10\bin\javaw.exe
Save file and execute eclipse.exe.
please try to execute java from
C:\Program Files\Java\jdk1.7.0_10\bin
i.e from the location where java is installed.
If it is successful, it means that the error lies somewhere in the classpath.
Also, this guy seems to have had the same problem as yours, check it out
Check that downloaded eclipse/JDK/JRE is compatible with your processor/OS architecture that is are they 32bit or 64bit?
Not able to run Appium {“message”:”A new session could not be created. (Original error: ‘java -version’ failed
I used Jdk 1.8 and JRE 1.8, Classpath is also set properly but I observed that Java command gives Error to initialization of VM (java/lang/NoClassDefFoundError: java/lang/Object)
Solution:
Uninstalled JRE and JDK completely
Installed JRE 1.8 then
Installed JDK 1.8
Set Classpath
check Java command works or not and its working
also able to execute the Appium program thru Eclipse Kepler Service Release 2 with JDK1.8 support
I had the same error in my case was when I needed to update jdk 7 to jdk 8, and my bad was just I installed jdk8 and I never installed jre8, only that, the error was solved immediately when I installed jre8.
Try placing the desired java directory in PATH before not needed java directories in your PATH.
I had the same issue on Windows 7 and I had to install both JDK and JRE and it's a success.
I faced the same problem,Eclipse splash screen for a second and it disappears.Then i noticed due to auto update of java there are two java version installed in my system. when i uninstalled one eclipse started working.
Thanks you..
I've observed this with STS and Eclipse and running java from CMD too on Windows 7/8/10 and following was my simple solution:
Actually, when I installed JDK 8 and STS/Eclipse it created one directory i.e. C:\ProgramData\Oracle\Java\javapath with the following files:
C:\ProgramData\Oracle\Java\javapath\java.exe
C:\ProgramData\Oracle\Java\javapath\javaw.exe
C:\ProgramData\Oracle\Java\javapath\javaws.exe
Along with that, it appended Path Environment variable of System with this location C:\ProgramData\Oracle\Java\javapath
I've just removed above entry from Path Environment variable of System and added the location of the actual JDK instead i.e. C:\Program Files\Java\jdk1.8.0_131\bin
Now that is not necessary to add that -vm option in eclipse.ini or
SpringToolSuite4.ini either.
I just spent about 1 hour to figure out possible solution for the same error.
So what I did under MS WIndows 7 is following
Uninstall all Java packages of all versions.
Download last packages Java SE or JRE for your 32 or 64 Windows and install it.
First install JRE and second is Java SE.
Open text editor and paste this code.
public class Hello {
public static void main(String[] args) {
System.out.println("test");
}
}
Save it like Hello.java
Go to Console and compile it like
javac Hello.java
Execute the code like
java Hello
Should be no error.
sometime you missed some file like I missed my one file rt.java
so better to check yours .........
C:\Program Files\Java\jdk1.8.0_112\jre\lib
0
I just spent about 1 hour to figure out possible solution for the
same error.
So what I did under MS WIndows 7 is following
Uninstall all Java packages of all versions.
Download last packages Java SE or JRE for your 32 or 64 Windows and
install it.
First install JRE and second is Java SE.
List item
Below error is thrown when there are multiple versions of jdk on your machine:
error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
so for this Just use below:
set PATH="JDK bin path" in cmd
I had a same issuse, my file location was in D-drive, and then i shifted to the c-Drive and it works.