< about the construction of the Java EE environment > tomcat,mysql,jdk in FEDORA21 and IntelliJ construction process

Source: Internet
Author: User

Digression: Initially very reluctant to write this no technical content of the blog, but online for fedora21 under the whole environment of the construction process of the article is very few, then I break an example:-P

(i) Download of JDK and setting of environment variable

If you have no desire for the JDK version, then congratulations, you can get it directly from the FEDORA21 built-in software library. JDK 567 with your choice (except JDK8) or you can use the following commands directly:

sudo yum seach jdk

sudo yum install jdk*** (the name is entered based on the results of the last command search)

But if it's a manual download of the JDK (http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) need to install manually:

RPM-IVH jdk name. rpm

If there is a dependency problem that needs to be addressed, you can reinstall the latest RPM or yum to install a lower version of the JDK:

sudo yum update

sudo yum reinstall rpm

Then configure the environment variables:

The JDK environment variables for Linux systems need to be set manually, before you need to know the location of your JDK before configuring it with the command:

Whereis Java

Find Java and JDK files based on the system's Echo directory

1. (If you do not have Vim installed) sudo yum install vim

2.sudo Vim/etc/profile

After entering, add the following code at the end of the profile file:

Export Java_home=/usr/java/jdk1.8.0_40export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jarexport Path= $PATH: $JAVA _home/bin

As shown: (Java_home directory must follow its own, the assignment of the path variable must be added $path otherwise will overwrite the original value, between each environment variable with: interval)

the last ZZ (write and save) is ready, in order to verify that you can logout the current user and then use the following command to verify: echo $JAVA _home

Echo $CLASSPATH

Echo $PATH

(ii) Tomcat installation is the simplest, directly from (http://tomcat.apache.org/download-80.cgi) extracted to their own view of the convenient directory is completed

In fact, we need to set the CATALINA_HOME environment variable to make it easy for us to launch Tomcat directly from the terminal (perhaps more useful, but I've never set it up right now). The Setup method is consistent with the settings of the JDK environment variable.

(iii) Installation and erection of MySQL and IntelliJ

MySQL can be downloaded directly from the official website, the Fedora version is very friendly, why choose IntelliJ? Because the school has an activation code:-P.

Or you can do it like I do:

sudo yum install MySQL

After the installation is complete, we need to do some other work, because it needs to be embedded in the programming, need a JDBC bridge, what should be done under Linux? Either download it directly from the website or enter the following command:

sudo yum search Mysql|grep connector

sudo yum search mysql-***** (mine is Mysql-connector-java.noarch)

If you download it with Yum, it's not going to help you assemble it, so I'm going to write my way out.

1. First in the file system (be sure to search in the "computer") find the JDBC Bridge you downloaded the usual suffix is a jar.

Then open your IntelliJ to do the following:

File->projectstructure->projectsettings->library as shown:

Click "Java" will let you choose a jar package, find just the JDBC Bridge package imported into the library can be, may wish to take the following Java code to try (this code requires TRY/CACTH block package):

Class.forName ("Com.mysql.jdbc.Driver");

If there is no error, then congratulations on your database connection has been completed ~

(Extra) If your fedora does not have a Workbenchgui version like mine, then do it as I say MySQL, using the following command:

Mysql-u root (no password required for first login)

Create USER ' username ' @ ' localhost ' identified by ' password '

The Mysql.user table can then be manipulated directly using the SQL language to manipulate the user's pull

For some commands on MySQL see:http://www.chinaz.com/program/2009/0115/62526.shtml

< about the construction of the Java EE environment > tomcat,mysql,jdk in FEDORA21 and IntelliJ construction process

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.