Install Ubuntu to build a J2EE development environment

Source: Internet
Author: User

1. Download

1. jdk
2. tomcat
3. mysql
4. mysql workbench
5. eclipse javaee

Ii. Install & configure Environment Variables
1. jdk 7
Unzip tar-xvf jdk-7u25-linux-x64.tar.gz
Move to the/opt/directory sudo mv jdk1.7.0 _ 25 // opt/
Configure Environment Variables

PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games: /usr/local/games:/opt/jdk1.7.0 _ 25/bin"
CLASS_PATH = "/opt/jdk1.7.0 _ 25/lib"
JAVA_HOME = "/opt/jdk1.7.0 _ 25"

Run the java and javac commands:
Sudo update-alternatives -- install/usr/bin/java/opt/jdk1.7.0 _ 25/bin/java 300
Sudo update-alternatives -- install/usr/bin/javac/opt/jdk1.7.0 _ 25/bin/javac 300
Select the default version:

Sudo update-alternatives -- config java
Whether the test is normal:

Java-version javac
2. tomcat

Tomcat is easy to install, decompress it, move it to opt, and start and close the script under tomcat/bin/to run it.
Pay attention to permission issues.
3. mysql 5.6

Install tarpackage mysql-5.6.13-linux-glibc2.5-x86_64.tar.gz
Unzip tar-zxvf mysql-5.6.13-linux-glibc2.5-x86_64.tar.gz
Rename music mysql-5.6.13-linux-glibc2.5-x86_64 mysql5.6
Transfer sudo mv mysql5.6/opt/
Go to the mysql folder cd mysql5.6/
Add mysql user groups and users:

Sudo groupadd mysql
Sudo useradd-r-g mysql
Change the user and User Group of the mysql5.6 Folder:

Sudo chown-R mysql.
Sudo chgrp-R mysql.
Run the installation script:

Sudo scripts/mysql_install_db -- user = mysql
Error: Installing MySQL system tables.../bin/mysqld: error while loading shared libraries: libaio. so.1: cannot open shared object file: No such file or directory
Install libaio. so.1 and execute:
Sudo apt-get install libaio-dev
Install libaio and run the mysql installation script.
Change the permission back and only keep the data directory as a mysql user
Sudo chown-R root.
Sudo chown-R mysql data
Copy the mysql configuration file to the etc directory (global configuration)

Sudo cp support-files/my-default.cnf/etc/my. cnf
Start mysql in the Mysql5.6 directory:

/Opt/mysql5.6 $ sudo bin/mysqld_safe -- user = mysql &
Initialize the mysql password:

Sudo bin/mysqladmin-u root password '123'
Modify the basepath of mysql. server

Vim support-files/mysql. server is the current directory. The default file path is/usr/local/mysql. You can copy the files to this directory from the beginning,
Copy the mysql. server script to/etc/init. d (initialize the service)

Sudo cp support-files/mysql. server/etc/init. d/mysql. server
View the mysql running status:

Sudo service mysql. server status
Close startup:

Sudo service mysql. server start | stop
Set to mysql boot: defaults boot, remove cancel boot

Sudo update-rc.d-f mysql. server defaults | [remove]
Add the mysql command to the command or add the mysql bin directory to the environment variable.
Sudo ln-s bin/mysql/usr/local/bin/mysql
Export PATH = $ PATH:/opt/mysql5.6/bin
Allow the root user to log on remotely:

Mysql-u root-p
Log on to all hosts
Grant all privileges on *. * to root @ "%" identified by "111111" with grant option;
Specify host Login

Grant all privileges on *. * to root @ "192.168.1.101" identified by "passw0rd" with grant option;
Authorization takes effect: flush privileges;
Supplement: an error is reported when workbench is installed. Refer to the solution below.

Cp support-files/mysql. server/etc/init. d/mysql
Chmod + x/etc/init. d/mysql
Vim mysql
# Modify the following two variables
Basedir =/home/software/mysql-5.5.20
Datadir =/home/software/mysql-5.5.20/data
Then run the update-rc.d mysql ults
# Use service mysql start to start again. The following error occurs:
# Couldn't find MySQL server (/usr/bin/mysqld_safe). The path is incorrect. You should not find mysqld_safe in/usr/bin. If you suspect that an error occurred while loading the configuration file during mysql startup, the read sequence of the mysql configuration file is as follows:
/Etc/my. cnf/etc/mysql/my. cnf/usr/local/mysql/etc/my. cnf ~ /. My. cnf
Check one by one and find that the above two values in/etc/mysql/my. cnf are incorrect. After modification, test and find that service mysql start can be used to start mysql.

For more details, please continue to read the highlights on the next page:

Build a J2EE development environment in Ubuntu

Build a J2EE environment in Linux

J2EE Lightweight architecture knowledge point sorting

Linux Course Design-in Linux, the J2EE development and running environment can be configured to enable jsp programs to access the database

For more information about how to install Ubuntu 13.10 on a hard drive in Windows 7, see

Ubuntu 13.10 download, installation, and configuration summary page

  • 1
  • 2
  • Next Page

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.