Deploy Java Backend Application

Source: Internet
Author: User

    1. Java program running mechanism, first of all to have a simple understanding of the JVM, Java program running with the help of the JVM. The JVM is a simulation that can be understood as a physical computer, has its own RAM, registers and other "hardware", the JVM is running after the Java compiler compiled the bytecode file, that is, the *.class file, the running portal is the specified. class file of the main () method.

      Take the HelloWorld program as an example to illustrate how the JVM runs a Java program:

    2. Package Test;public class HelloWorld {public static void main (string[] args) {System.out.println ("Hello world!");}}
      Using the Java command under the Jre/bin directory to start a Java virtual machine, Java command parameters can be entered in Java view at the command line, the required parameter format is as follows:

      Java options-classpath Run_class args

      Options open the JVM parameter configuration, support multiple parameter settings, such as JVM size setting-xmx256m-xms64m,-DFILE.ENCODING=GBK output character set, etc.

      Run_class identity Identifies the Java class name that needs to be run, note the need to bring the full package name

      Calsspath identifies the path that the JVM looks for when it executes the. calss file

The following bat script:

@echo on
Set Classpath=f:\eclipse_workspace\demo\bin
Set option=-dfile.encoding=gbk-xmx256m-xms64m
Set Run_class=test. Test04
Java%option%-classpath%classpath%%run_class%

Starting JVM,JVM with the option parameter will use ClassLoader to load the Run_class specified under-calsspath and call the main () method

The above is just a simple introduction, one question is whether the-classpath class is the JVM loading or loading the specified run_class

Deploy Java Backend Application

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.