Configuration and considerations for Linux Java and Android environments

Source: Internet
Author: User

Last time Linux, and later with the Java environment, the android environment several times have been unable to enter the system, the whole I either use shell box to modify the configuration file, or reload, these days are also using Linux, Incidentally, take the time to summarize a loss: (some of the steps can be implemented through the shell, for the sake of convenience I directly dictate)

First, configure the JDK:

1. First extract your JDK to the directory you want to install

2. If you start configuring environment variables:

Environment variables are divided into global variables, user variables, temporary environment variables. As the name implies, the first is the environment variables that are valid for all Linux users , the second one is to set the environment variables that are private to the user, and the third is the variables that are all invalidated after the current user logs off. Here we take the global variables as an example:

SETP1, enter the system root directory under the ETC folder, open the profile file as an administrator

SETP2, after opening, paste the following environment variables into the end of the file

Export java_home=/opt/jdk7export path= $PATH: $JAVA _home/bin: $JAVA _home/jre/binexport classpath= $CLASSPATH:.: $JAVA _ Home/lib: $JAVA _home/jre/lib  

#第一行即就是我们安装jdk的路径

#第二行就开始配PATH变量了, the Linux environment variable is separated from the Windows semicolon by a colon:. Since there is more than one environment variable configuration file under Linux, we always need to remember references to the possible environment in front of you , that is $PATH. and then the same is different from the Windows variable reference, we are in Linux under the United States knife $ To reference, if we send a certain place will often use a path variable, we can do this way to implement the reference. There are a total of two bin paths under the JDK and JRE configured here.

#第三个是CLASSPATH路径的配置, also two Lib


# # #Notice # #

In the configuration of the environment, it is important to note that in the = side do not add any space symbols, usually write code customary plus space this habit, let me fall on this issue more than two times 、、、 mother eggs!!!

Step3, saving files

SETP4, set the JDK you installed as the system default JDK (if necessary)

sudo update-alternatives--install/usr/bin/java  java/opt/jdk7/bin/java 300sudo update-alternatives--install/ Usr/bin/javac  

Already configured, you can now log out of the login and log in again to make the configuration effective and use the Java-version command to view the currently installed JDK version.


Ii. Configuring the Android Studio and Eclipse or SDK

The specific configuration of the environment is already clear in the first step, the same decompression installation, and then the environment configuration ... It is recommended that you do not put these things in the system directory, because the system is the default is only the root user has the highest permissions, although we can be modified through sudo, but in the running program or install plug-ins, the creation of virtual machines, you need to constantly modify or add things. This often occurs because of insufficient permissions, installation, or failure to run the error. Here we speak directly to them in our user directory. When configuring the environment, the path configuration principle is the same as under Windows, which should be matched with what to do with what to pay attention to, if you are worried that your path is wrong, you can type the path of the CD through the Shell box, and then dir or LS to see if you enter the corresponding directory to check your path correctness.


Thirdly, after the environment software is well-equipped

If you use the shell to start the software, you can not remember the name of the hard to write, you may go to the system directory under the bin or usr/bin to find the corresponding executable file as an administrator to change to your favorite name, Then you can happily use the shell to launch the software (if some software automatically generated shortcuts to the desktop, you modify these things as Windows lost the original file reference); Some software executable shell script if there is no shortcut on the desktop, You can drag yourself onto the desktop to make a



# # # #温馨提示 # #

Originally is a very simple thing, online a lot of tutorials are no problem, is because some notes do not explain white, let me this small white wrong to go a lot of road ~~~~~ good, I said so much, there are problems can also give me comment comments, very happy and everyone to discuss the various uses of Linux, common progress!!!

PS: Here upload a copy of my profile, you can refer to the reference

Configuration and considerations for Linux Java and Android environments

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.