Running Java programs

Source: Internet
Author: User

Java's three technology platforms: Javase, Java EE, javameJdk:java Development Kit, the core of the entire Java, including Java compilers, running tools, etc.Jre:java Runtime enviroment, Java operating environmentpath: Where to store Java's compilation and run toolsclasspath: Used to save the. class file path allowed by the Java Virtual machine, and also to enable the VM to find the required class fileWrite a One.java fileUsejavac command to compile: Javac One.java//generates One.class fileUsejava command to run: Java oneSome subdirectories of the JDKBin (binary): Storage of some executable program/application (. exe) DB: Small database include: Because the JDK is implemented using c,c++, some header files need to be introduced at startup. : Java Program Runtime Environment Lib (library): Java class library/library file, archive package file used by development tools operating mode:1: Integrated software(Android Studio because it has a JDK, JRE, so write directly with this, run) Open Android Studio, open an existing projectFile--->new----> New Module--->java librayThe underlined part, change as you want.Library Name: Libclass Name: MyClassThe first line should be commented out! (I don't know the reason). However, the Java code is not commented out when it is written, the runtime will comment, because it will be a little different. Once you've written your code, you're ready to run.regenerate into a Java fileFile----> New---->java Class
Without a step-by-step full diagram, many operations are the same.

2: CommandRun-cmd-switch to the path where the target file is located-compile-runjavac command to compile: Javac Helloworld.java//generates One.class fileUsejava command to run: Java HelloWorld //This time only requires the class name to (at compile time, it can be any. java file, but, at run time, the Java command must be followed by a. class file that contains the main function. ) Beginner Java Soon, if there are errors please also point out, grateful.

Running Java programs

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.