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"