Running Java programs under "Linux" Linux

Source: Internet
Author: User

Reference to the Http://www.cnblogs.com/howard-queen/archive/2012/01/30/2331795.html

First step: Use Vim to write a Java program First.java is written in the JDK bin directory

 Public class first{      publicstaticvoid  main (String args[]) {        System.out.println ( "This is my first program." );      }    }

Step two:./javac/usr/java/jdk1.8.0_25/bin/first.java compile Build First.class

Step three: Run./java First output results

Note that if the source file is not written in the Java Bin directory, it is necessary to copy the First.class file to the bin directory to run, or the main class will be found without error.

Running Java programs under "Linux" Linux

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.