JAVA programming under Ubuntu10.04

Source: Internet
Author: User
The JDK environment was successfully configured under Ubuntu10.04 the day before yesterday. today I want to implement JAVA programming under this operating system! Okay, just do it. First, you have to create a document. However, when I right-click the document and find that the document creation option in my directory is gray...

The JDK environment was successfully configured under Ubuntu10.04 the day before yesterday. today I want to implement JAVA programming under this operating system! Okay, just do it.
First, you have to create a document. However, when I right-click the document and find that the "create document" option in my directory is gray. in this case, my directory is: /usr/lib, and then I go to my own directory. for example, if my account is han, then I am at/home/han. then I right click, I found that "creating a document" was usable, and then I tried other directories in this directory to find that it was usable, once you leave this directory, it becomes unusable. At this time, I suddenly realized that it was only in my own user directory that I had the permission to create documents, but not in other directories that I could run with the administrator account, such as sudo touch han. java. Therefore, operations in operating systems like Windows are relatively safer.
Finally, I created a Test. java file under the "document". The content is as follows:
Public class Test {
Public static void main (String [] args)
{
System. out. println ("Hello World! ");
}
}
 
Next, open the terminal and enter the following command in it for compilation:
Javac Test. java
After successful compilation, a file named Test. class is generated under the "document" directory.
Then enter the following command in the terminal:
Java Test
The execution result is as follows:


This shows that the environment for Java programming and development under Ubuntu has passed the test, and the next step is the actual development work.

Author "50"
 

Related Article

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.