Tag: Call Path window under Environment Cal Zha--logs tells
Java
I. When installing the JDK the second time you select the installation directory, this is the JRE that is installed and can be canceled directly.
Two. Configure three environment variables (under WIN7)
Right-click My Computer > Properties > Advanced system Settings > Environment variables > System variables.
1. Create a new variable with the variable name: Java_home variable Value: D:\Program files\java\jdk1.8.0_121 (installation directory for JDK)
Role:
(1) Convenient reference. For example, Java_home represents the installation directory of the JDK. Then to use this path when setting environment variables, just enter%java_home% to avoid entering a long path for each reference.
String.
(2) similar to the C language macro definition. When the JDK path is forced to change, you only need to change the value of the Java_home variable. Otherwise, change any document that references the JDK directory with an absolute path, and if there is no change, a process
Can not find the JDK, the consequences are imagined----system crashes!
(3) Some of the three-party software will refer to the agreed java_home variable, otherwise it will not run the software properly. And so after a long time Java will come into contact, if a software does not work properly, may wish to think of this reason.
2. Modify the variable, the variable name: The Path variable value is:%java_home%\bin; (add to the front, one behind;)
Role:
System variable path tells the operating system executable (*.exe, etc.) where the path, when the operating system to find an executable file, the operating system from the current directory to find the executable file, if not found, the operation
The system goes to the path where it is located, and then executes. This means that the executable file in the path stored in the paths can be executed anywhere.
When you run the Java program in CMD, you need to use Java.exe, Javac.exe, and the operating system will find the appropriate application in the current path and path, and execute it.
3. New variable, variable named CLASSPATH variable value is:.; %java_home%\lib (where to find the. class file that needs to be executed, preceded by a.; )
Role:
Classpath tells the Java Virtual Machine (JVM) where to put the *.class files to be used or executed. Add a previous [.] is because when you compile a Java file, such as executing Javac xxx.java in cmd, the
In the previous directory to generate the Xxx.class file, and then execute Java XXX, the system will be in the current directory to find the Xxx.class file, so to add, the representative is in the current directory to find a class file to execute.
Three. Execute Java and javac in Cmd, if not present:' XXXX ' is not an internal or external command, it is not a running program or a batch file. Indicates that the environment variable is configured successfully.
Four. CMD running Java program
1. Tap the Java code in Notepad and modify the. java extension.
2. Switch to the directory stored by Xxx.java in CMD.
3.cmd execution: Javac xxx.java (Generate Xxx.class file)
4.cmd execution: Java XXX (running Java program)
Five. Eclipse is used (the eclipse itself is written in Java, so you need to install the JDK and configure the Java environment before installation, otherwise eclipse will not open)
1. Right-click on the left margin to select New>java Project, fill in the name, and click Finish.
2. In the new project, right-click New>package, fill in the name (preferably all lowercase), click Finish.
3. In the new package, right-click New>class, fill in the name (preferably all uppercase), click Finish.
4. Click on a green button in the toolbar to run.
6. Turn off auto-completion brackets: window>preference>java>editor>typing>automatically Close, the first three items are the auto-completion of quotation marks, parentheses, and curly braces.
7. Set the font: Window>preference>general>appearance>colors and Fonts>basic>text Front
8. Modify the workspace:
(1) File>switch Workspace>other
(2) Window>preferences>general>startup and shutdown>workspace, tick prompt for Workspace on Startup.
Python
I. Installing Python
Two. Configure the environment variable path, add the Python installation directory to the variable name.
Three. Execute python in cmd if it does not appear: ' XXXX ' is not an internal or external command, nor is it a program or batch file that can be run. Indicates that the environment variable is configured successfully and enters the Python interactive mode
Four. CMD Run python program
Interactive mode:
1.cmd execute python into interactive mode
2. Enter Python code
In interactive mode, the Python code executes one line at a line per entry.
Edit mode:
1. Use Notepad to tap the Java code and modify the extension to. Py
2. Switch to the directory stored by xxx.py in CMD.
3.cmd execution: Python xxx.py can run Python programs.
Five. Pycharm use
1. The Python version (Python 2.x or Python 3.x) will be selected during installation
2. In the toolbar file>new project> Select the project storage directory >create>open in the Window>add to currently opend projects
3. Right-click New>python file> Enter file name in new project
4. Click on a green button in the toolbar to run.
5. Close Bracket Auto Completion: File>settings>editor>general>smart Keys,insert pair bracket is the management bracket, Insert pair quote is the management quotation mark
6. Set the font: File>settings>editor>colors&fonts>font
Reference:
Http://www.cnblogs.com/zhangpengshou/p/4232204.html
http://blog.csdn.net/ljheee/article/details/50810570
Java and Python installation and compiler use