Linux under OpenNMS compilation

Source: Internet
Author: User
Tags opennms

1.1 Source code compilation 1.1.1 access to source code

The corresponding version of the source code can be obtained through the website or GitHub, according to the individual needs of the download, the latest stable version of 14.0.3, it is recommended to download this version. Specific as follows.

Website

Url

OPENNMS official website

http://sourceforge.net/projects/opennms/files/OpenNMS-Source/old/opennms-source-14.0.3-1.tar.gz

GitHub

Https://github.com/OpenNMS/opennms

Once the download is complete, copy it to the OPT directory and unzip it using the following command.

TAR-ZXVF opennms-source-14.0.3-1.tar.gz

Then go to the OPENNMS root directory and modify the Pennms-14.0.3-1 permissions. As follows.

Chmod-r 777/opt/opennms-14.0.3-1/*

1.1.2 Compilation Environment 1.1.2.1 Uninstall OPENJDK

Because OPENNMS recommended the use of Sun's JDK, it is necessary to uninstall the system's own openjdk, as described below.

1. First, you need to see which version of OPENJDK is currently installed, enter the Java–version, as shown below.

# java-version
Java Version "1.6.0_45"
Java (TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot (TM) 64-bit Server VM (build 20.45-b01, Mixed mode)

2. Uninstall OPENJDK and enter the following command.

#rpm-qa| grep JDK

#rpm-e--nodeps java-1.6.0-openjdk-1.6.0.0-1.62.1.11.11.90.el6_4.x86

_64
# rpm-e--nodeps java-1.7.0-openjdk-1.7.0.25-2.3.10.4.el6_4.x86_64
# rpm-e--nodeps tzdata-java-2013c-2.el6.noarch.

3. Enter java–version again to indicate that no such command has been uninstalled.

1.1.2.2 Installing Sun JDK

Sun's jdk1.7 and above are recommended, and the jdk1.7 version is used in this example and is jdk-7u55-linux-x64.tar.gz after download.

1. First, execute the command in the/usr/java directory to extract the JDK installation package.

TAR–ZXVF jdk-7u55-linux-x64.tar.gz

2. Open the/etc/profile file to add content to configure the JDK environment variables.

Export java_home=/usr/java/jdk1.7.0_55

Exportclasspath=.: $JAVA _home/jre/lib/rt.jar: $JAVA _home/lib/

Dt.jar: $JAVA _home/lib/tools.jar

Export path= $PATH: $JAVA _home/bin

3. Save the above changes and exit, immediately execute the source/etc/profile command, so that the changes take effect.

4. Execute the java–version command to see if the JDK was successfully installed, indicating that the installation was successful.


1.1.2.3 Configuring MAVEN

Because OPENNMS has its own MAVEN environment, the default is in the OpenNMS root directory, so it is used directly.

1. The following command configures the MAVEN path to the system environment variable, as follows;

Export M2_home=/opt/opennms-14.0.3-1/maven

Export path= $PATH: $JAVA _home/bin: $M 2_home/bin

2. When the above configuration is completed, if you need to modify the local MAVEN Library storage address (/ROOT/.M2), you can enter the/opt/opennms-14.0.3-1/maven/conf settings.xml file, the red part is the default address, as follows;


3. Save the above changes and exit, immediately execute the source/etc/profile command, so that the changes take effect.

4. Execute the mvn–version command to see if MAVEN is installed successfully, and if the version information appears, the installation is successful and if not, check the configuration information.

1.1.3 Compilation Project

1. First need to clear the source of the compiled cache, enter the source code root directory, execute./clean.pl command.

2. The red section shows the success of emptying.


3. If the command line does not appear with the above information, the clean fails, then the change is based on the prompt information, and then re-clean until the prompt is successful.

4. After step 3 is complete, execute the./compile.pl command to compile.

5. The red part of the appearance indicates that the compilation was successful.


6. If the compilation fails, it is generally due to the dependent package cannot be downloaded, can be recompiled, or manually download the dependency package into the corresponding directory of the MAVEN repository, compile multiple times until successful.

7. After the compilation is complete, the compiled file needs to be packaged, executed command:

./assemble.pl-dopennms.home=/opt/opennms

Note:/OPT/OPENNMS is the directory at the time of deployment

8. The red part appears, which indicates that the project was packaged successfully.

Note: There are discrepancies in the red version, whichever is the actual


9. According to the above prompts, find opennms-14.0.3.tar.gz in the root directory of Opennms/target, then the installable files.

Lost Jian file
Reprint Please specify link: http://blog.csdn.net/awenluck/article/details/48597717

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Linux under OpenNMS compilation

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.