Installing JDK1.7
1. Download the required JDK version jdk-7u79-linux-x64.tar.gz:jdk historical version download path
2. Extracting files
After unpacking, add a folder as follows:
3. Create a folder to save the extracted files: (/usr/lib General storage can not be directly run, but many of the programs are necessary to run some library files in the Linux Common directory detailed)
4. Move the extracted files to the specified folder:
5. Open the configuration file and modify:
At the end of the file, add the following: Set Linux environment variables
#set java environmentexport JAVA_HOME=/usr/lib/java/jdk1.7.0_79export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATH
保存后退出。
执行sudo source /etc/profile使其立即生效。
关闭终端,再次打开终端查看是否安装成功。
执行java -version
Install Eclipse
1 Download the Eclipse compact package first:
2 Creating the installation directory: (view Linux directory introduction)
3 Decompression:
4 创建桌面快捷方式:sudo touch /usr/share/applications/Eclipse.desktop
5 打开文档写入以下内容:
Exec:配置安装eclipse目录下的eclipse
Icon:配置安装eclipse目录下的图片
[Desktop Entry]
Encoding=UTF-8
Name=Eclipse
Comment=Eclipse
Exec=/usr/lib/eclipse/eclipse
Icon=/usr/lib/eclipse/icon.xpm
Terminal=false
StartupNotify=true
Type=Application
Categories=Application;Development;
6 Give Execute permission:
7安装成功后桌面显示如标:
在桌面打开 eclipse ,结果提示没有安装JDK,JRE环境。
Workaround:
sudo ln-sf $JAVA _home JRE and create a soft link in the Eclipse folder that points to the JRE path
Install the TOMCAT7 and configure it in Eclipse
1 Download the compressed package on the official website;
2 Create a new installation directory;
3 Extract to installation directory: Use TAR-ZXVF compressed file-C to specify directory
4 Modifying the configuration file:
Modify the catalina.sh file under modified Tomcat/bin:
installation directory for Catalina_home=tomcat
JAVA_HOME=JDK installation directory
5 Configuring Environment variables:
To modify the/etc/profile file:
installation directory for export Catalina_home=tomcat
Then execute: source/etc/profile effective
6 start Tomcat as described in configuration success:
7 add tomcat to eclipse times error: Click OK directly when you encounter permissions problem
8 Open the Tomcat v7.0 Server at Localhost-config folder under Eclipse servers there is no Tomcat related configuration file, Tomcat then copies the configuration files under Tomcat's Conf file into the Conf configuration file under Serviers under Eclipse's workspace:
9 View the files under Tomcat v7.0 Server at localhost-config under servers:
10 permissions to modify these files: sudo chmod 777 *, modified to look as follows:
11 then click Servers in Eclipse and press F5 to refresh to use Tomcat!
installing Databases Mysql5.7 and phpMyAdmin
1 Execute the following three commands:
sudo apt-get install Mysql-server
sudo apt isntall mysql-client
sudo apt install Libmysqlclient-dev
2 detect if MySQL is installed successfully:
sudo netstat-tap | grep MySQL
3 mysql operation command:
Service MySQL Start/stop/restart on, stop, restart the MySQL service
4. Change the root user password, note that the root user's password is a random string and needs to be modified when mysql5.7 is installed. Run sudo netstat-tap First | grep MySQL to see if MySQL was installed successfully:
5 View the user and password in the configuration file:
6 then log in to MySQL in another window:
7 The following interface appears to indicate successful login:
8 To change the root user password:
9 Log in as the root user:
10 See if Ubuntu MySQL supports utf-8:
SHOW VARIABLES like ' collation_% ';
Show variables like ' character_set_% ', if the display is all utf-8 right, if there is not utf-8 you need to modify the configuration file:
Then add two words at the end of the file:
Character-set-server=utf8
Collation-server=utf8_general_ci
Then restart the MySQL service: service MySQL restart, and then view:
It means the configuration is successful!
11 After a successful configuration, you can install a database of graphical interface phpMyAdmin, note the installation process remember to configure the user name and password.
Install git
1 Execution command error is as follows:
2 to perform the APT update command:
3 Appearance Select Y:
Then install git:
4 to detect if Git is installed successfully:
5 Set user name and mailbox:
6 View the settings for the user name and mailbox:
7 Get more parameters can be viewed using the git-help help command;
Installing Maven3.3.3
1. First download maven compressed tar file on the official website, Apache's official website does not open reference this link to configure the Gateway, pro-Test can: Configure the gateway to visit the Apache official website
2. Create the directory where MAVEN is installed, then unzip the download file to this directory;
3. Configure environment variables: Open the/etc/profile file to add:
#set maven environmentexport M2_HOME=/usr/lib/maven/apache-maven-3.3.3(Maven安装目录)export CLASSPATH=$CLASSPATH:$M2_HOME/libexport PATH=$PATH:$M2_HOME/bin
Then execute source/etc/profile to make the file effective
4. Create a new MAVEN Dynamic Web project in Eclipse:
5 Note The Web project is configured as a war package:
After 6 finish, right-click the project-->properties-->project facets remove the dynamic Web module and apply
7 then check the dynamic Web module, below the Blue configuration link click:
8 Configure the following:
9 Click OK to finish!
Build a Java development environment under Ubuntu16.04lts