In other Linux versions, I use readhat5 and JDK 6, Tomcat 6, and MyEclipse6 to install JDK (1). the downloaded binfile can be directly run in Linux to change the permission: # Install the chmod755jdk-1.6.0_23-linux-i586.rpm.bin :#. /& nbs
In other Linux versions, I use readhat5 and JDK 6, Tomcat 6, and MyEclipse6.
Install JDK
(1) The downloaded binfile can be run directly in Linux.
Change permissions:
- # Chmod755Jdk-1.6. 0_23-linux-i586.rpm.bin
Install:
- #./Jdk-1.6. 0_23-linux-i586.rpm.bin
After this step is complete, a file for the jdk-1.6.0_23-linux-i586.rpm is generated
Install:
- # Rpm-ivh jdk-1.6. 0_23-linux-i586.rpm
Installed in/usr/java/jdk1.6.0 _ 23 by default
(2) Set environment variables in/etc/profile
Add the following content to the file header. modify the configuration according to the actual installation path:
- JAVA_HOME=/Usr/java/jdk1.6.0 _ 23
- JRE_HOME=/Usr/java/jdk1.6.0 _ 23/jre
- PATH= $ PATH: $ JAVA_HOME/bin: JRE_HOME/bin
- CLASSPATH=.: $ JAVA_HOME/lib/jt. jar: $ JAVA_HOME/lib/tools. jar: $ JRE_HOME/lib
- Export JAVA_HOME JRE_HOME PATH CLASSPATH
Press Esc, And then: wq save and exit
Make environment variables take effect
- # Source/etc/profile
# Echo $ JAVA_HOME
(The JDK directory is displayed)
In addition, many times, the following command is used to check whether the command takes effect.
- # Java-version
However, if you have installed Java before, printing is not the current version. We need to modify the reference of the java command.
Path:
- # Cd/usr/bin
Delete the application. Enter y when prompted:
- # Rm java
Add a new connection:
- # Ln-s/usr/java// Usr/java/jdk1.6.0 _ 23/java
Note:
If your java version is incorrect, it may cause exceptions when installing other software, such:
Cocould not find a valid configuration for intro part and Unable to locate the application's 'main' class
Download tomcat Linux
1. Download apache-tomcat-6.0.29.tar.gz
// Extract
2)
- # Tar-zxvf apache-tomcat-6.0.29.Tar.gz
3) copy the extracted file and add apache-tomcat-6.0.29 to a directory.
Copy the file to the bin directory in the folder.
4) start Tomcat
- #./Startup. sh
5) stop the service
- #./Shutdown. sh
Note:
If the process cannot be stopped, you can use Linux to kill the process. Run the kill command to terminate the process. -9 indicates that the process is forced to stop immediately.
- # Ps-ef | grep java
- # Kill-9[PID]
First, install Eclipse. Don't confuse it. MyEclipse is just a plug-in of Eclipse.
Download Eclipse Linux
1)download eclipse-sdk-3.3.1.1-linux-gtk.tar.gz
2) decompress
- # Tar-zxvf eclipse-SDK-3.3.1.1-Linux-gtk.tar.gz
3) copy the decompressed file and add eclipse to a directory.
4) Run eclipse in the copied directory
Install MyEclipse
Download MyEclipse Linux
1) download MyEclipse_6_0_1GA_E3_3_1_Installer.bin
2) Run and install
- #./MyEclipse_6_0_1GA_E3_3_1_Installer.bin
The installation page is the same as that in Windows. When selecting the Eclipse path, select the copied Eclipse path.
Installation path select a path based on the actual situation
After installation, run Eclipse again or run MyEclipse. sh under MyEclipse to open MyEclipse.
Enter the verification code below.
Configure Tomcat, select window-preferences in eclipse, select Myeclipse-Servers-Tomcat6 in the pop-up window
Select the Tomcat copy path and configure JDK 6, then select "Enable" on the Tomcat server, and Apply in the lower right corner to exit.
Create a project test for testing
Add the following content to index. jsp of the created web project:
- <% @ PageLanguage="Java" Import="Java. util .*" PageEncoding=UTF-8"%>
- >
- <Html>
- <Head>
- <Title>My service testing Title>
- Head>
- <Body>
- <% = System. getProperty ("java. version") %>
- Body>
- Html>
Access: http: // localhost: 8080/test/
Page output: 1.6.0 _ 23. This is the Java version used by the current service.