Install JDK, Maven, and Jboss on CentOS

Source: Internet
Author: User
Tags in domain

Install JDK, Maven, and Jboss on CentOS

All previous projects were deployed in the windows system environment. This time, we tried to deploy them in the Linux system environment, so this time, we have installed JDK, Maven, and Jboss on seven hosts, one of which has installed Mysql, and configured the lan. Finally, we are done. The installation steps are as follows!

System Version: centos6.332-bit Operating System

Hardware configuration: Kernel Intel (R) Pentium (R) 4 CPU 3.00 GHz memory 998.5 M

Installation environment: use shell commands

JDK Installation

1. Check whether the system has been installed. If yes, uninstall and install the target version.

[Html] view plaincopy
  1. Rpm-qa | grepjdk

2. If the installed version is a java-1.6.0-openjdk-1.6.0.0-1.7.b09.el5, run the following command

[Html] view plaincopy
  1. Rpm-e -- nodepsjava-1.6.0-openjdk-1.6.0.0-1.7.b09.el5

After uninstallation, run the command in step 1 to check whether the uninstallation is successful.

3. Our installation package jdk-8u45-linux-i586.rpm, run the following command to install [html] view plaincopy
  1. Rpm-ivhjdk-8u45-linux-i586.rpm
Run this command to install jdk under/usr/java/java1.8.0 _ 45.

4. If you do not have the permission to execute the installation command, you can execute the following command to authorize

[Html] view plaincopy
  1. Chmod + xjdk-8u45-linux-x64.rpm

5. Modify the name of the JDK folder to unify the path.

[Html] view plaincopy
  1. Mv/usr/java/java1.8.0 _ 45/usr/java/jdk1.8
6. Run this command to open the profile file and configure environment variables for JDK.

[Html] view plaincopy
  1. Vi/etc/profile

Vi open the file. After opening the file, the default mode is command mode. Enter a or I to enter the edit mode. The following prompt is insert... At the end of the file, configure the following variables. After editing, Press ESC to exit the editing. Then, enter wq or: x to save and exit. Configure as follows:

7. Save and exit to make the change take effect

[Html] view plaincopy
  1. Source/etc/profile

8. Check the version information and check whether the configuration is correct.

[Html] view plaincopy
  1. Java-version
If the following information appears, the installation and configuration are successful.

Maven Installation

You can directly copy the destination folder to the destination folder without installation, and configure the environment variables.

The 1. file is apache-maven-3.2.5-bin.tar.gz. You must decompress the file first.

[Html] view plaincopy
  1. Tar-zxvfapache-maven-3.2.5-bin.tar.gz

2. Move the extracted file to/usr/local and name it mamen-3.2.5

[Html] view plaincopy
  1. Mvapache-maven-3.2.5/usr/local/maven-3.2.5

3. Edit the profile file and configure the environment variables.

[Html] view plaincopy
  1. Vi/etc/profile

Edit as follows:


4. Make the edit take effect

[Html] view plaincopy
  1. Source/etc/profile

5. Check the version information and check whether the configuration is correct.

[Html] view plaincopy
  1. Mvn-v
If the following information is displayed, the configuration is successful.

Jboss Installation

It is also a installation-free method. You can configure it. The hosts file is jboss-eap-6.2.zip.

1. Put the JBoss compressed package under usr/local. This command is for decompression.

[Html] view plaincopy
  1. Unzipjboss-eap-6.2.zip

2. Rename the file jboss-eap-6.2 to jboss6.2 and copy it to usr/local/

[Html] view plaincopy
  1. Mvjboss-eap-6.2jboss6.2

3. Start jboss

You can first enter the bin directory of JBoss through cd/usr/local/jboss6.2/bin, and then enter the command. /run. sh: it will ask you whether you want to start the server in standalone (standalone mode) or domain mode. Select the corresponding commands provided by the standalone server as needed.
./Standalone. sh stands for standalone mode.
./Domain. sh is the domain Mode
When running a command, you may encounter a prompt with insufficient permissions. You can use the following command:

Chmod 777 *

Add read/write/execute permissions to all files/folders.

View the console output command to check whether the startup is successful

4. Add a JBoss user. There are two types of users: management and application. follow the steps below.

Run this command under/usr/local/jboss6.2/bin.

[Html] view plaincopy
  1. /Add-user.sh

Follow the prompts to add a user.

Jboss is configured here.

The memory usage of the two jboss instances running in domain mode is shown as follows:

Before startup

After startup

Memory usage seems a little urgent. Wait for the deployment test to see if you want to expand the memory.

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.