Linux compilation executes Java engineering

Source: Internet
Author: User

One, the installation of the Java environment on Linux
wget HTTP://10.100.51.30:8080/SOFTWARE/JDK-7U71-LINUX-X64.RPMRPM-IVH jdk-7u71-linux-x64.rpm

Try java-v after installation.

If you have a version number that prints out the JDK, the installation succeeds

two installation of Maven on Linux
Ac= 'ls/opt/maven|WC-l 'if[[$AC-eq0]]; ThenCD/optwget-Q http://10.100.51.30:8080/software/apache-maven-3.3.3-bin.tar.gz tar-xf apache-maven-3.3.3-bin.tar.gz rm-rf maven MV A pache-maven-3.3.3 maven Rm-f apache-maven-3.3.3-bin.tar.gzAC=`grep/opt/maven/bin/etc/profile|WC-L 'EchoAc=$ACif[[$AC-eq0]]; Then     EchoExport Maven_home=/opt/maven>>/etc/profileEchoExport path=\ $PATH:/opt/maven/bin>>/etc/profilefiSource/etc/ Profilefi

After installation, try Mvn-v if the print is unsuccessful. Try to close this connection, re-open a connection mvn-v, no, cd/opt, see if there is a maven directory.

Compilation of three simple Java projects on Linux

Upload the written *.java file to Linux. Use the SFTP tool, put *.java-"upload file, put-r com-" upload directory.

Then go to the Java file directory,

Compile command Javac Test.java

Execute the named Java test

The results are output to the screen or to the file directory.

Four Java projects that rely on other jar packages are compiled and executed

If the project is a MAVEN project. You can compile execution on Linux based on Maven. The pom.xml in Maven writes about the jar packages that the project relies on.

It will automatically download the required jar package to start compiling.

Under the Pom.xml directory

Maven compile to compile

Maven Test for execution

Linux compilation executes Java engineering

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.