簡體   English   中英

NativeScript 安裝

[英]NativeScript installation

安裝 NativeScript 后,我在嘗試運行以下命令時遇到此錯誤ns doctor

C:\Program Files\Eclipse Adoptium\jdk-11.0.17.8-hotspot\bin;
C:\Program Files\Common Files\Oracle\Java\javapath;
C:\Program Files\Python310\Scripts\;
C:\Program Files\Python310\;
C:\WINDOWS\system32;
C:\WINDOWS;
C:\WINDOWS\System32\Wbem;
C:\WINDOWS\System32\WindowsPowerShell\v1.0\;
C:\WINDOWS\System32\OpenSSH\;
C:\Program Files (x86)\dotnet\;
C:\Program Files\Java\jdk-19\bin;
C:\Program Files\Git\cmd;C:\WINDOWS\system32>ns doctor
√ Getting environment information

TIP: To avoid setting up the necessary environment variables, you can use the chocolatey package manager to install the Android SDK and its dependencies.

There seem to be issues with your configuration.
√ Getting NativeScript components versions information...
√ Component nativescript has 8.4.0 version and is up to date.
√ Your ANDROID_HOME environment variable is set and points to correct directory.
√ Your adb from the Android SDK is correctly installed.
√ The Android SDK is installed.
√ A compatible Android SDK for compilation is found.
√ Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
× Error executing command 'javac'. Make sure you have installed The Java Development Kit (JDK) and set JAVA_HOME environment variable.
 You will not be able to build your projects for Android.
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
 described in https://docs.nativescript.org/environment-setup.html

× WARNING: The Java Development Kit (JDK) is not installed or is not configured properly.
 You will not be able to work with the Android SDK and you might not be able
to perform some Android-related operations. To ensure that you can develop and
test your apps for Android, verify that you have installed the JDK as
described in http://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html (for JDK 8).

Your environment is not configured properly and you will not be able to execute local builds.
Verify that your environment is configured according to the system requirements described at
https://docs.nativescript.org/environment-setup.html.
C:\Users\Admin\AppData\Local\Android\Sdk\platform-tools;
C:\Program Files\Java\jdk-17.0.5\bin;
C:\ProgramData\chocolatey\bin;
C:\Program Files\nodejs\;
C:\Users\Admin\AppData\Local\Microsoft\WindowsApps;
C:\Users\Admin\AppData\Local\Programs\Microsoft VS Code\bin;
C:\Program Files (x86)\BrowserStackLocal\;
C:\Program Files\JetBrains\IntelliJ IDEA 2022.1.3\bin;
C:\Program Files\MongoDB\Server\5.0\bin;
C:\Users\Admin\AppData\Local\Programs\mongosh\;
C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.2.3\bin;
C:\Users\Admin\AppData\Roaming\npm

Also when I checked my Environment variables I can see this

```
C:\Program Files\Eclipse Adoptium\jdk-11.0.17.8-hotspot\bin;
C:\Program Files\Common Files\Oracle\Java\javapath;
C:\Program Files\Python310\Scripts\;
C:\Program Files\Python310\;
C:\WINDOWS\system32;
C:\WINDOWS;
C:\WINDOWS\System32\Wbem;
C:\WINDOWS\System32\WindowsPowerShell\v1.0\;
C:\WINDOWS\System32\OpenSSH\;
C:\Program Files (x86)\dotnet\;
**C:\Program Files\Java\jdk-19\bin;**
C:\Program Files\Git\cmd;
C:\Users\Admin\AppData\Local\Android\Sdk\platform-tools;
**C:\Program Files\Java\jdk-17.0.5\bin;**
C:\ProgramData\chocolatey\bin;
C:\Program Files\nodejs\;
C:\Users\Admin\AppData\Local\Microsoft\WindowsApps;
C:\Users\Admin\AppData\Local\Programs\Microsoft VS Code\bin;
C:\Program Files (x86)\BrowserStackLocal\;
C:\Program Files\JetBrains\IntelliJ IDEA 2022.1.3\bin;
C:\Program Files\MongoDB\Server\5.0\bin;
C:\Users\Admin\AppData\Local\Programs\mongosh\;
C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.2.3\bin;
C:\Users\Admin\AppData\Roaming\npm

是不是多個jdk導致了這個問題,請指導我

提前致謝:)

我嘗試查看命令行錯誤中標記為紅色的文檔以及谷歌上的文檔,但它無處談論多版本問題

  1. 請刪除 JDK。

  2. 運行 OpenJDK11U-jdk_x64_windows_hotspot_11.0.17_8.msi 再次安裝 JDK。

  3. 彈出設置向導Window,點擊Next

  4. 然后自定義設置,

(4-1) 在Set JAVA_HOME variable中,下拉選項,select Entire feature will be installed on local hard drive ,(4-2) 在JavaSoft(Oracle) registry keys中,下拉選項,select Entire feature will be installed on local hard drive

  1. 然后點擊Next ,點擊Install ....

重點是步驟4-2,Register JavaSoft(Oracle) registry keys ,部分windows應用程序會檢查JavaSoft(Oracle)注冊表項,部分Windows應用程序會檢查是否存在JavaSoft Oracle Registry Keys作為判斷系統是否有JDK的依據安裝。

這與是否設置了JAVA_HOME 或PATH 無關。 這些程序用於檢查 JavaSoft Oracle 注冊表項是否存在。

就像 launch4j 將檢查 JavaSoft Oracle 注冊表項。

步驟4-2是假設Eclipse Adoptium JDK是JavaSoft Oracle JDK。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM