You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our system requirements point that JAVA_HOME must be set, but `tns doctor` is not strict about this.
With version 1.7.0 of the runtime, `jarsigner` from $JAVA_HOME/bin/jarsigner will be called explicitly, so we must be sure JAVA_HOME is correct.
`jarsigner` does not exist in JRE, so add logic to call it in order to verify that the currently set JAVA_HOME is correct.
Validate the information in the following order:
1) Check if JAVA_HOME is set. In case it is not, you cannot build for Android (`tns build android` will fail before starting).
2) Check if JAVA_HOME is correct by executing JAVA_HOME/bin/jarsigner - in case it does not exist - fail
3) Check if the version of the JAVA is correct by calling JAVA_HOME/bin/javac -version and compare it with min required one. In case it's lower - fail.
`tns doctor` will print warning in case any of the above check fails. `tns build android` and any other Android related build operations will fail.
letadditionalMessage="You will not be able to build your projects for Android."+EOL
164
+
165
+
lethelpfulMessage="You will not be able to build your projects for Android."+EOL
166
166
+"To be able to build for Android, verify that you have installed The Java Development Kit (JDK) and configured it according to system requirements as"+EOL+
167
167
" described in https://github.com/NativeScript/nativescript-cli#system-requirements.";
this.printMessage(`Javac version ${installedJavaVersion} is not supported. You have to install at least ${AndroidToolsInfo.MIN_JAVA_VERSION}.`,additionalMessage);
this.printMessage("JAVA_HOME environment variable points to incorrect path. Make sure it points to the installation directory of JDK.",helpfulMessage);
173
192
}
174
193
}else{
175
-
hasProblemWithJavaVersion=true;
176
-
this.printMessage("Error executing command 'javac'. Make sure you have installed The Java Development Kit (JDK) and set JAVA_HOME environment variable.",additionalMessage);
194
+
hasProblemWithJavaHome=true;
195
+
this.printMessage("JAVA_HOME environment variable is not set.",helpfulMessage);
this.printMessage(`Javac version ${installedJavaVersion} is not supported. You have to install at least ${AndroidToolsInfo.MIN_JAVA_VERSION}.`,helpfulMessage);
209
+
}
210
+
}else{
211
+
hasProblemWithJavaVersion=true;
212
+
this.printMessage("Error executing command 'javac'. Make sure you have installed The Java Development Kit (JDK) and set JAVA_HOME environment variable.",helpfulMessage);
0 commit comments