Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to download and install j2ee development environment for Ubuntu

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "how to download and install the j2ee development environment for Ubuntu". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

First, download

1.jdk

2.tomcat

3.mysql

4.mysql workbench

5.eclipse javaee

II. Install & & configure environment variables

1.jdk 7

Decompress tar-xvf jdk-7u25-linux-x64.tar.gz

Move to sudo mv jdk1.7.0_25/ / opt/ under / opt/ directory

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"

Execute the java,javac command:

Sudo update-alternatives-install / usr/bin/java java / opt/jdk1.7.0_25/bin/java 300

Sudo update-alternatives-install / usr/bin/javac javac / opt/jdk1.7.0_25/bin/javac 300

Select the default version:

Sudo update-alternatives-config java

Test to see if it is normal:

Java java-version javac

2.tomcat

Tomcat is relatively easy to install, extract and move to opt. There are startup and shutdown scripts under tomcat/bin/, which can be run.

Pay attention to the issue of permissions.

3.mysql 5.6

Install the tarpackage MySQL-5.6.13-linux-glibc2.5-x86_64.tar.gz

Decompress tar-zxvf mysql-5.6.13-linux-glibc2.5-x86_64.tar.gz

Rename mv mysql-5.6.13-linux-glibc2.5-x86_64 mysql5.6

Transfer sudo mv mysql5.6 / opt/

Enter the mysql folder cd mysql5.6/

Add mysql user groups and users:

Sudo groupadd mysql

Sudo useradd-r-g mysql mysql

Change the users and user groups to which the mysql5.6 folder belongs:

Sudo chown-R mysql.

Sudo chgrp-R mysql.

Execute the installation script:

Sudo scripts/mysql_install_db-user=mysql

Error report: Installing MySQL system tables.. . / bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

Libaio.so.1 needs to be installed, execute:

Sudo apt-get install libaio-dev

Install libaio and then run the mysql installation script to install successfully.

Change the permissions back, leaving only the data directory as the 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&

Password to initialize mysql:

Sudo bin/mysqladmin-u root password '111111'

Modify the basepath of mysql.server

Vim support-files/mysql.server is the current directory, and the default path of the file is / usr/local/mysql. Lazy students can copy it to this directory from the very beginning.

Copy mysql.server script to / etc/init.d (initialize service)

Sudo cp support-files/mysql.server / etc/init.d/mysql.server

View the running status of mysql:

Sudo service mysql.server status

Start and shut down:

Sudo service mysql.server start | stop

Set at mysql boot startup: defaults boot startup, remove cancel boot startup

Sudo update-rc.d-f mysql.server defaults | [remove]

Add the mysql command to the command or add the bin directory of mysql to the environment variable

Sudo ln-s bin/mysql / usr/local/bin/mysql

Export PATH=$PATH:/opt/mysql5.6/bin

Allow root users to log in remotely:

Mysql-u root-p

Log in to all hosts

Grant all privileges on *. * to root@ "%" identified by "111111" with grant option

Designated host login

Grant all privileges on *. * to root@ "192.168.1.101" identified by "passw0rd" with grant option

Authorization takes effect: flush privileges

Add: after installing workbench, it suddenly starts to report an error, refer to the solution

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 execute update-rc.d mysql defaults

# then use service mysql start to try to start and report an error:

# Couldn't find MySQL server (/ usr/bin/mysqld_safe), the path is incorrect. You should not look for mysqld_safe under / usr/bin. It is suspected that there was an error loading configuration file when mysql started. The reading order of mysql configuration file is as follows:

/ etc/my.cnf / etc/mysql/my.cnf / usr/local/mysql/etc/my.cnf ~ / .my.cnf

One by one, it is found that the above two corresponding values in / etc/mysql/my.cnf are incorrect. After modification, it is found that service mysql start can be used to start mysql.

4.mysql workbench

Install mysql-workbench-community-6.0.6-1ubu1304-amd64.deb version, simple and easy. . .

Practice has proved that this is the most Fuck method. . . . . . . . See the following for details. . . . . . . . .

5.eclipse javaee

Decompress: tar-xvf

Move to the / opt directory: mv eclipse / opt

Modify user groups and permissions:

Sudo chown-R root:root eclipse/

Sudo chmod-R + r eclipse

Sudo chmod + x `sudo find eclipse-type d`

Establish an executable:

Sudo touch / usr/bin/eclipse

Sudo chmod 755 / usr/bin/eclipse

Sudo vim / usr/bin/eclipse is added as follows:

#! / bin/sh

Export ECLIPSE_HOME= "/ opt/eclipse"

$ECLIPSE_HOME/eclipse $*

Establish a quick startup method:

Sudo vim / usr/share/applications/eclipse.desktop is added as follows:

[Desktop Entry]

Encoding=UTF-8

Name=Eclipse

Comment=Eclipse IDE

Exec=eclipse

Icon=/opt/eclipse/icon.xpm

Terminal=false

Type=Application

Categories=GNOME;Application;Development

StartupNotify=true

Initialize Eclipse:

/ opt/eclipse/eclipse-clean

Everythin is ok! Experience as much as you can.

Add:

Rar decompression tool: sudo apt-get install rar unrar

Mysql installation supplement:

After installing mysql in the above way, it starts normally, and then installs mysql workbench. . . . . . At this point, mysql workbench will automatically generate a / etc/mysql/my.cnf file, which will be called in the startup step with mysql.service. This file is in mysql5.5 format, and the direct result is that Mysql5.6 cannot be started! No matter how you change it. . . . Finally, copy the my.cnf overwrite from the mysql installation directory, start, and succeed. . . . . . . . . . . . . . .

The log file path / var/log/mysql/error.err of the configuration file generated by workbench needs to be built. Mysql will not survive automatically, so you can see the error log.

Command line login mysql error: Can't connect to local MySQL server through socket'/ var/run/mysqld/mysqld.sock

Modify the socket configuration of / etc/mysql/my.cnf

[client]

Socket = / tmp/mysql.sock

[mysqld]

Socket = / tmp/mysql.sock

Restart mysql,ok!

This is the end of the content of "how to download and install the j2ee development environment for Ubuntu". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report