(node:16112) UnhandledPromiseRejectionWarning: CordovaError: Failed to run "javac -version", make sure that you have a JDK installed.
You can get it from: http://www.oracle.com/technetwork/java/javase/downloads.
Your JAVA_HOME is invalid: C:\Program Files (x86)\Java\jre1.8.0_171
I checked my user environment variable and I have the variable JAVA_HOME and set to "C:\Program Files (x86)\Java\jre1.8.0_171"
I also have C:\Program Files (x86)\Java\jre1.8.0_171 appended to the user environment variable PATH.
make sure you have a JDK installed
This is the relevant part of this error message. Your JAVA_HOME points to a Java Runtime Environment (JRE), not to a Java Development Kit (JDK).
javac is the Java compilation command, which Cordova is attempting to execute in this case. However, javac is not shipped with the JRE as it is a development tool.
You need to download and install a JDK and set JAVA_HOME to point to it
Related
When I am testing java -version , javac -version im getting a proper version in the cmd output ., but when I run the app from appcelerator I'm getting this below error., JAVA_HOME has been set properly .
[ERROR] Application Installer abnormal process termination. Process exit value was 1
[ERROR] : JDK (Java Development Kit) not installed.
[ERROR] : If you already have installed the JDK, verify your JAVA_HOME environment variable is correctly set.
[ERROR] : The JDK is required for Titanium and must be manually downloaded and installed from http://appcelerator.com/jdk.
Most of all, if you get proper outout for java -version or javac -version it doesn't mean JAVA_HOME environment variable had already set. If your PATH environment variable contains java / javaw / javac binaries, you can run it but JAVA_HOME hadn't set. You should check it with: echo %JAVA_HOME%
Other thing is, Appcelerator requires JDK (Java Development Kit). JRE is not enough. But it seems you have JDK, because javac is not part of JRE edition.
At last look for yourself the right version of JDK and Appcelerator you have downloaded. E.g. both of those are for 64-bit operating systems.
Related issues:
[1] https://jira.appcelerator.org/browse/AC-6020
[2] https://github.com/appcelerator/atom-appcelerator-titanium/issues/129
I am unable to launch the UI Automator viewer can anyone help me ?how can I launch it? when I double click on "uiautomatorviewer" for some time black window opens but closed automatically even I had set variables in windows path variable
ANDROID_HOME%\tools;
%ANDROID_HOME%\platform-tools;
even i am not sure how I can alaunch it?
If your using JDK 9 or 10 Please downgrade it to JDK 8. It should solve the problem.
Also ensure you have set the below path's correctly.
ANDROID_HOME C:\Users\xxx\AppData\Local\Android\Sdk
JAVA_HOME C:\Program Files\Java\jdk1.8.0_181
Under path in System variables
C:\Users\xxx\AppData\Local\Android\Sdk\tools\bin
C:\Users\xxx\AppData\Local\Android\Sdk\tools
C:\Users\xxx\AppData\Local\Android\Sdk\platform-tools
C:\Program Files\Java\jdk1.8.0_181\bin
Adding here as Answer so that It should be clear to everyone.
Found a solution which DON'T NEED ONE TO DOWNGRADE TO JAVA 8+
so, there is an option for JRE to run VM for "uiautomatorviewer".
Step:1
One needs to install Android Studio
Step:2
Add the below location to "path" System Variable-
C:\Program Files\Android\Android Studio\jre\bin
I have jdk-11.0.6 and "uiautomatorviewer" is working fine
I add this to Path C:\Program Files\Android\Android Studio\jre\bin in system variable
>>> java --version
openjdk 11.0.13 2021-10-19
OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
OpenJDK 64-Bit Server VM (build 11.0.13+0-b1751.21-8125866, mixed mode)
>>> javac --version
javac 11.0.13
I also try by set
JAVA_HOME C:\Program Files\Android\Android Studio\jre
ANDROID_HOME C:\... ...\Android\SDK
add bellow lines into Path
%ANDROID_HOME%\tools;
%ANDROID_HOME%\tools\bin;
%ANDROID_HOME%\platform-tools;
but when I try to open uiautomatorviewer.bat it show me 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
Edit the uiautomatorviewer.bat file
rem set java_exe=
call ..\lib\find_java.bat
edit to
set java_exe=C:\Program Files\Android\Android Studio\jre\bin\java.exe
rem call ..\lib\find_java.bat
try to run uiautomatorviewer.bat it show me error :-(
-Djava.ext.dirs=..\lib\x86_64;..\lib is not supported. Use -classpath instead.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
is there no way except downgrade jdk1.8.xx.xx.xx!!!!
So I am trying to create a Workspace for eclipse from gradlew. And I am getting the following error:
Execution failed for task ':makeStart'.
> Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Program Files\Java\jre1.8.0_131"
But I`ve set JRE_HOME and JAVA_HOME correctly(JAVA_HOME points to jdk folder and JRE_HOME to jre folder). But gradlew sees wrong jdk path. What may caurse this problem?
It is currently set to "C:\Program Files\Java\jre1.8.0_131"
That means you do not have a JDK installed, but a JRE, meaning, you only have the runtime environment but not the development kit that contains the compiler.
Install a Java JDK and set the environment accordingly.
I have JDK (both 1.7.0.3 and 1.8.0) installed. I have added path C:\Program Files\Java\jdk1.7.0_03\bin or C:\Program Files\Java\jdk1.8.0 alternately and also have added system variable JAVA_HOME with C:\Program Files\Java\jdk1.7.0_03 or C:\Program Files\Java\jdk1.8.0 respectively.
I have downloaded typesafe activator with play, and extracted it in my C:\ drive. Then when I try to run it by activator.bat or by command activator ui from CMD the following error(s) are shown:
C:\activator-1.0.13>activator ui
'"C:\Program Files\Java\jdk1.8.0\bin\java.exe" -version 2>&1' is not recognized
as an internal or external command,
operable program or batch file.
'"C:\Program Files\Java\jdk1.8.0\bin\javac.exe" -version 2>&1' is not recognized
as an internal or external command,
operable program or batch file.
A Java JDK is not installed or can't be found.
JAVA_HOME = "C:\Program Files\Java\jdk1.8.0"
Please go to
http://www.oracle.com/technetwork/java/javase/downloads/index.html
and download a valid Java JDK and install before running Activator.
If you think this message is in error, please check
your environment variables to see if "java.exe" and "javac.exe" are
available via JAVA_HOME or PATH.
I am using MS Windows 7.
Additional information:
C:\activator-1.0.13>javac -version
javac 1.8.0
C:\activator-1.0.13>java -version
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)
C:\activator-1.0.13>activator ui
'"C:\Program Files\Java\jdk1.8.0\bin\java.exe" -version 2>&1' is not recognized
as an internal or external command,
operable program or batch file.
'"C:\Program Files\Java\jdk1.8.0\bin\javac.exe" -version 2>&1' is not recognized
as an internal or external command,
operable program or batch file.
A Java JDK is not installed or can't be found.
JAVA_HOME = "C:\Program Files\Java\jdk1.8.0"
Please go to
http://www.oracle.com/technetwork/java/javase/downloads/index.html
and download a valid Java JDK and install before running Activator.
If you think this message is in error, please check
your environment variables to see if "java.exe" and "javac.exe" are
available via JAVA_HOME or PATH.
I was having a similar problem on Windows...
'C:\Program' is not recognized as an internal or external command
Installing Java to a path without spaces and using that as my JAVA_HOME fixed the problem for me.
This worked for me:
1. Open a Command Prompt as administrator
3. Navigate to the folder with activator.bat
4. Type 'activator ui' without the '
5. Press enter
compile:
BUILD FAILED
D:\adt-bundle-windows-x86_64-20131030\sdk\tools\ant\build.xml:601: The following
error occurred while executing this line:
D:\adt-bundle-windows-x86_64-20131030\sdk\tools\ant\build.xml:720: The following
error occurred while executing this line:
D:\adt-bundle-windows-x86_64-20131030\sdk\tools\ant\build.xml:734: Unable to fin
d a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Program Files\Java\jre7"
path is ::C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;
C:\Windows\System32\Wind
owsPowerShell\v1.0\;
C:\Program Files (x86)\MySQL\MySQL Utilities 1.3.6\;
D:\Progr
am Files\nodejs\;E:\practicum\Softwares\apache-ant-1.9.3\bin;
E:\practicum\Softwa
res\adt-bundle-windows-x86_64-20131030\adt-bundle-windows-x86_64-20131030\sdk\pl
atform-tools;
E:\practicum\Softwares\adt-bundle-windows-x86_64-20131030\adt-bundl
e-windows-x86_64-20131030\sdk\tools
;C:\Program Files\Java\jdk1.7.0_25\lib;C:\Pro
gram Files\Java\jdk1.7.0_25\bin;
C:\Users\srinivas\AppData\Roaming\npm;
Please tell me how to refix the problem.
Make "JAVA_HOME " variable point to a JDK installation, not JRE.
You are referencing the runtime environment, not the development kit - it can't find the compiler because its not there.
It should be something like this:
"C:\Program Files\Java\jdk1.7.0_51"
However the path and the JDK version may vary on your system.
As it says
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Program Files\Java\jre7"
Your JAVA_HOME is set to JRE it should be set to JDK
set your JAVA_HOME to
C:\Program Files\Java\jdk1.7.0_25\bin;
or to the version of jdk is available