Chapter 2 Java programming environment and Chapter 2 java programming

Source: Internet
Author: User

Chapter 2 Java programming environment and Chapter 2 java programming
2.1 install Java development toolbox 1. Java terminology

  • Software used by programmers who compile Java programs using JDK-Java Development Kit
  • Software used by users who run Java programs in JRE-Java Runtime Environment
  • Update-an update is called when minor version changes are made to solve some urgent problems.
  • JDK (including compiler)> JRE> JVM
  • Java SE-Java Standard Edition, applicable to the Java platform of desktop or simple server applications
  • Java EE-Java Enterprise Edition: a Java platform for complex server applications
2. Install JDK
  • In Windows, it is strongly not recommended to install jdk in the directory path to be spaces, such as Program Files
2. Set the execution Path (Path)
  • The execution path refers to the directory list of local executable files searched by the operating system.
  • Unix (Linux) Setting Method: In ~ /. Bashrc or ~ /. Add: export PATH = jdk/bin: $ Path at the end of the bash_profile File
  • In Windows, log on as an administrator and right-click "computer, advanced System settings-> environment variables-> system variables-> Path variables-> set jdk \ bin to the beginning of the variable, and use semicolons to isolate the variable values
  • In shell, run javac-version to check whether jdk is successfully installed.
3.installation Library source file (src.zip.pdf and document (jdk-version-apidocs.zip)
  • Library source file
1) install jdk and set the execution path. 2) Open the shell window. 3) enter the jdk directory (cd c: \ jdk1.7.0). 4) create a subdirectory src mkdir src cd src 5) run the unzip command: jar xvf .. \ src.zip
  • Document
1) install jdk and set the execution Path 2) download the compressed file http://www.oracle.com/technetwork/java/javase/downloads, and put it in the jdkdirectory 3) Open the shell window 4) enter the jdk directory 5) run the unzip command jar-xvf jdk-version-apidocs.zip 4. jdk directory description 2.2 select the development environment
  • Eclipse
  • NetBeans
2.3 use the command line tool
  • Javac Welcome. java
1) The javac program is a java compiler, which transfers the file Welcome. compile java into Welcome. class 2) command for temporarily canceling the classpath environment variable in Windows: set CLASSPATH = command in Linux: export CLASSPATH =
  • Java Welcome
Send to JVM, And the JVM executes the bytecode that the compiler stores in the class file.
2.4 use the integrated development environment 2.5 run the graphical application 2.6 create and run the applet
  • Applet-Java's ability to run an applet in a browser
Javac WelcomeApplet. java // compile the applet code appletviewer WelcomeApplet.html // applet viewer

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.