Configure JDK and SDK environment variables
JDK environment Configuration Computer – Properties – Advanced System Settings – at the bottom right corner is a “environment variables” – below “system variables” – New
Create an environment variable JAVA_HOME with the value JAVA_HOME. C:\Program Files\Java\jdk1.8.0_241 Click ok.
2, add %JAVA_HOME%\bin to PATH environment variable (note that PATH may exist, do not add;
3, create a new variable named CLASSPATH with the value of %JAVA_HOME%\lib\rt.jar; %JAVA_HOME%\lib\tools.jar
To test whether the JDK is installed successfully, choose “Start” – > “Run”, or directly press the combination key “Win + R”, enter “CMD” in the command box, press Enter to enter the DOS interface (black box), enter “Java -version” in the command line.
The JDK installation is successful if the message shown in the preceding figure is displayed.
The environment configuration of the SDK is the same as that of the Java JDK, computer — Properties — Advanced System Settings — a “environment variable” in the bottom right corner — “System Variable” — New
1. Create a new environment variable named ANDROID_HOME and value: D: adt-bundle-windows-x86_64-20140702\ SDK (use your installation directory, make sure there are tools and Add-ons in it) and click OK.
2. Add the value of the user variable PATH. %ANDROID_HOME%\platform-tools; Click ok. Add to system variable path; D:\adt-bundle-windows-x86_64-20140702\sdk\tools
Test whether the JDK is installed successfully: click Run — enter CMD — Enter ADB — enter, if a pile of English appears, as shown in the following picture, that is, the configuration is successful, then enter Android, start Android SDK Manager. Or type “Android-h”.
The configuration of the NDK
1. The first step is to install the NDK using the SDK Tools of SDKManager.
2. In the second step, specify the NDK position for AS. After downloading, open File — Project Structure — SDK Location, click the drop down arrow and select the default Location.
3. Configure environment variables.
3.1. Copy the installation position of the NDK.
3.2. Right-click My Computer > Properties > Advanced System Settings > Environment Variables > New, add a system variable NDK_HOME, and fill in the path of the copied NDK-bundle.
3.3. Find the Path system variable (no need to create it), create a new %NDK_HOME%, which is the NDK_HOME variable above.
Step 4: Test. Restart the AS. In the Terminal command line interface, run the ndk-build command. If the following output is displayed, the NDK is installed and configured successfully.
If you have already configured the JDK or SDK and want to modify it in AndroidStudio, what can you do? Directly above:
\