Showing posts with label how. Show all posts
Showing posts with label how. Show all posts

Monday, June 8, 2015

How to install setup maven repository in jboss brms bpmsuite rhel7 centos7


This is quite simple thing.
If you are going to start jboss brms fresh instance without installing maven in your machine, you cannot start the server and it will ask you to set M2_HOME (M2_HOME is not set, cannot start kie workbench)
First you have to install apache maven in your machine,
Download the zip file from http://maven.apache.org/download.cgi site.
Then unzip the file,

#unzip apache-maven-bin.zip
 
Copy the extracted file to /opt/ like below and create a link to usr/bin/,

#cp apache-maven/ /opt/maven
#ln -s /opt/maven/bin/mvn /usr/bin/mvn
 
Now you have to setup environment variables using below commands.

#vi /etc/profile.d/maven.sh
 
Add the following contents:

#!/bin/bash
M2_HOME=/opt/maven
PATH=$M2_HOME/bin:$PATH
export M2_HOME
export PATH
export CLASSPATH=.
 
Save and close the file and give privileges using below command

#chmod +x /etc/profile.d/maven.sh
 
Run below command to make variables permanent,

#source /etc/profile.d/maven.sh

Now you have successfully installed maven in your machine,
Check maven version using below command

#mvn –-version

Note that if it says about permission problem in mvn, go to the directory location and give +x permissions to the file and again try to view version.

Now you have maven and you can start jboss brms without problems. But before starting the server you need to map jboss-brms-bpmsuite-<version>-maven-repository repository to your maven installation settings file.

First download brms repository from Redhat site.

By default there is no setting.xml file in your fresh maven installation location in ~/.m2

Create settings.xml file and insert below sample maven profile details to the settings.xml,

#cd ~/.m2
#vi settings.xml

Add below code,

<profile>
<id>jboss-brms-bpmsuite-repository</id>
<repositories>
<repository>
<id>jboss-brms-bpmsuite-repository</id>
<url>file://<repository_location></url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>jboss-brms-bpmsuite-plugin-repository</id>
<url>file://<repository_location></url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>

<activeProfiles>
<!-- Optionally, make the repository active by default -->
<activeProfile>jboss-brms-bpmsuite-repository</activeProfile>
</activeProfiles>

After done this configuration, you have successfully installed the jboss brms and can run and access brms server without problems.

Monday, March 23, 2015

How to install oracle java 7 in RHEL7 CentOS7



If you have RHEL 7 fresh installed machine, there must be installed open java as the default java installation. If you want to change java environment to oracle java 7, follow below commands,
First check existing java version,

[akila@localhost u01]#  java -version

It will give you the existing java version like below,

java version "1.7.0_51"

OpenJDK Runtime Environment (rhel-2.4.5.5.el7-x86_64 u51-b31)

OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode)



To install oracle jdk, first you have to download it from oracle site,
Locate the downloaded file in a specific location, let’s name it as <location>.
Extract downloaded tar file using tar command,

[akila@localhost u01]# tar xzf jdk-7u60-linux-x64.ta

Now install java using alternatives command,

[akila@localhost u01]# alternatives --install /usr/bin/java java  <location>/jdk1.7.0_60/bin/java 2

 [akila@localhost u01]# alternatives --config java

Now you can check java version changed to oracle java 7,

[akila@localhost u01]#  java -version

java version "1.7.0_60"

Java(TM) SE Runtime Environment (build 1.7.0_60-b19)

Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)

Now you have to set JAVA_HOME and add it to PATH,

[akila@localhost u01]#  export JAVA_HOME="<location>/jdk1.7.0_60"

[akila@localhost u01]# JRE_HOME="<location>/jdk1.7.0_60/jre"

[akila@localhost u01]# export PATH=$PATH: JAVA_HOME/bin: JAVA_HOME/jre/bin

Above commands are only for temporarily. To make changes permanently, you have to update .bash_profile
By default .bash_profile file looks like below,

# .bash_profile



# Get the aliases and functions

if [ -f ~/.bashrc ]; then

        . ~/.bashrc

fi



# User specific environment and startup programs



PATH=$PATH:$HOME/bin


export PATH

Edit the file like below,

# .bash_profile



# Get the aliases and functions

if [ -f ~/.bashrc ]; then

        . ~/.bashrc

fi



# User specific environment and startup programs



JAVA_HOME="/<location>/jdk1.7.0_60"

JRE_HOME="/<location>/jdk1.7.0_60/jre"



export JAVA_HOME

export JRE_HOME



PATH=$PATH:$HOME/bin:/ <location>/jdk1.7.0_60/bin:/ <location>/jdk1.7.0_60/jre/bin



export PATH

Now you have successfully installed java 7 in your RHEL/CentOS 7 machine