Install Eclipse and Helloworld in Ubuntu
Before installing Eclipse in Ubuntu, you must configure JDK 1.7 In Debian as in [Linux], and install JDK 1.7 In Ubuntu as in Linux Java Helloworld (click to open the link, the entire installation process is even simpler than Debian. During the installation process, you can easily drag files into the terminal, so that you do not need to enter such a long path. The only difference between Ubuntu and Debian is that you can add sudo in front of the command to execute the command as a root user.
1. Download and install Eclipse
1. First, download the latest version of Luna SR2http: // www.eclipse.org/downloads/packages/release/Luna/SR2 (click to open the link) to download the latest version of Eclipse for JavaEE Linux 32bit/64bit, there are not many differences between different versions of Eclipse, while Eclipse for JavaEE also contains the content of JavaEE and Java. It is convenient to write Java EE in the future without additional plug-ins.
2. After the installation is completed, the eclipse-jee-luna-sr2-linux-gtk.tar.gz folder will be thrown to it, and the machine restart content will disappear in the/tmp folder, so that you do not need to delete the installation file after installation.
3. Open the terminal and enter the following command:
sudo tar zxvf '/tmp/eclipse-jee-luna-SR2-linux-gtk.tar.gz' -C /usr/lib
Wait for a round of decompression.
By now, Eclipse has been installed. Eclipse is a green version in any system, which must be liked by Eclipse!
However, to make it easier for us to use it, we still need to enter the following command to create a desktop shortcut for Eclipse. First, we need to configure a shortcut for Eclipse under the/usr/share/applications/directory.
4. Enter the following information on the terminal:
$ sudo gedit /usr/share/applications/eclipse.desktop
Terminal warnings are ignored. In the pop-up text editor, enter:
[Desktop Entry]Type=ApplicationName=EclipseComment=Eclipse Integrated Development EnvironmentIcon=/usr/lib/eclipse/icon.xpmExec=/usr/lib/eclipse/eclipseTerminal=falseCategories=Development;IDE;Java;
Save and launch.
5. Then open the file system and find the/usr/share/applications/Eclipse icon below. Right-click and copy it to the desktop, the Eclipse shortcut is created.
Ii. Use of Eclipse and Helloworld
1. Directly click Eclipse on the desktop, which looks exactly like Windows.
2. When you start it for the first time, you will be asked to set the working directory. Set it according to the default working directory. You asked me to select other directories. Select and set it as the default working directory.
Then you can find the working directory in the main folder of the file system. All the Java projects you have created are here.
3. When the welcome page is closed, it prompts that this is the JavaEE work environment, but you do not need to pay attention to it. Right-click the workspace to create a project, such:
4. Select a Java Project
5. After Entering the name, remember to select the JDK1.7 we just installed. Do not use the default JDK to avoid such problems.
6. Click Next. Do not click Finish in a hurry. In Order and Export, select the JDK1.7 just installed and click Finish.
7. Right-click the newly created Java project to create a class, that is, the Java file.
8. After writing the name, check the primary function creation. You do not need to write it yourself.
9. Use the same shortcut key as Windows Ctrl + space to set the Linux input method, and add the System that prints "Hello, world. out. click Run at the top of the println Java statement to view the running result. This is exactly the same as Eclipse in Windows.