Showing posts with label centos. Show all posts
Showing posts with label centos. Show all posts

Wednesday, August 15, 2012

Installing Maven On CentOS

Copy from key2start wordpress

Installing Maven On CentOS

05APR
These are the simple sequences for making maven work on a CentOS machine.
Pre-requisite : Java to be installed, check using java -version
1. Download the current maven version from the prescribed repository, http://maven.apache.org/download.html. I use to work with maven version 2.0.11 and hence downloaded using,
> wget http://www.eng.lsu.edu/mirrors/apache//maven/binaries/apache-maven-2.0.11-bin.tar.gz
Please wait while it is downloaded as a tar archive.
2. Extract the archive to the desired maven home directory, which can be a common, /usr/local/
So move the downloaded apache-maven-2.0.11-bin.tar.gz to /usr/local/ path using mv command or a short way can be use the wget command told before after going to the /usr/local/ path. Any way no issues..
> mv apache-maven-2.0.11-bin.tar.gz /usr/local
> cd /usr/local
> tar -zxvf apache-maven-2.0.11-bin.tar.gz
This will extract the apache-maven-2.0.11 directory into /usr/local/
3. Create sym link..
> ln -s apache-maven-2.0.11 maven
4. Open ~/.bashrc file with vi ~/.bashrc and add the following lines to the end of the file,
export M2_HOME=/usr/local/apache-maven-2.0.11
export PATH=${M2_HOME}/bin:${PATH}
5. AT last execute the environment changes with the command,    
> . ~/.bashrc
Check the installation with,
> mvn -version

http://key2start.wordpress.com/2011/04/05/maven-on-centos/

Thursday, June 14, 2012

Install JDK 6 in CentOS 5.5




[root@www jvm]# wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2Ftechnetwork%2Fjava%2Fjavase%2Fdownloads%2Fjdk6-downloads-1637591.html;" http://download.oracle.com/otn-pub/java/jdk/6u33-b03/jdk-6u33-linux-x64-rpm.bin


[root@www jvm]# mv jdk-6u33-linux-x64-rpm.bin\?AuthParam\=1339658940_4918ae55fd15b9077dd6590269b247c6  jdk-6u33-linux-x64-rpm.bin


[root@www jvm]# sh ./jdk-6u33-linux-x64-rpm.bin
Unpacking...
Checksumming...
Extracting...
UnZipSFX 5.50 of 17 February 2002, by Info-ZIP (Zip-Bugs@lists.wku.edu).
  inflating: jdk-6u33-linux-amd64.rpm
  inflating: sun-javadb-common-10.6.2-1.1.i386.rpm
  inflating: sun-javadb-core-10.6.2-1.1.i386.rpm
  inflating: sun-javadb-client-10.6.2-1.1.i386.rpm
  inflating: sun-javadb-demo-10.6.2-1.1.i386.rpm
  inflating: sun-javadb-docs-10.6.2-1.1.i386.rpm
  inflating: sun-javadb-javadoc-10.6.2-1.1.i386.rpm
Preparing...                ########################################### [100%]
   1:jdk                    ########################################### [100%]
Unpacking JAR files...
        rt.jar...
        jsse.jar...
        charsets.jar...
        tools.jar...
        localedata.jar...
        plugin.jar...
        javaws.jar...
        deploy.jar...
Installing JavaDB
Preparing...                ########################################### [100%]
   1:sun-javadb-common      ########################################### [ 17%]
   2:sun-javadb-core        ########################################### [ 33%]
   3:sun-javadb-client      ########################################### [ 50%]
   4:sun-javadb-demo        ########################################### [ 67%]
   5:sun-javadb-docs        ########################################### [ 83%]
   6:sun-javadb-javadoc     ########################################### [100%]

Java(TM) SE Development Kit 6 successfully installed.

Product Registration is FREE and includes many benefits:
* Notification of new versions, patches, and updates
* Special offers on Oracle products, services and training
* Access to early releases and documentation

Product and system data will be collected. If your configuration
supports a browser, the JDK Product Registration form will
be presented. If you do not register, none of this information
will be saved. You may also register your JDK later by
opening the register.html file (located in the JDK installation
directory) in a browser.

For more information on what data Registration collects and
how it is managed and used, see:
http://java.sun.com/javase/registration/JDKRegistrationPrivacy.html

Press Enter to continue.....


Done.

[root@www jvm]# rpm -Uvh jdk-6u33-linux-amd64.rpm
Preparing...                ########################################### [100%]
        package jdk-1.6.0_33-fcs.x86_64 is already installed

# sh ./jre-6u30-linux-i586-rpm.bin
# alternatives --config java
There are 2 programs which provide 'java'.
  Selection    Command
-----------------------------------------------
*+ 1           /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
   2           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
Enter to keep the current selection[+], or type selection number:

Note number of versions, N, and use N+1 (if there is no output from the previous command, just imagine that N=0) - For example, if 2 versions were installed then:
# alternatives --install /usr/bin/java java /usr/java/latest/bin/java 3
# alternatives --config java
There are 3 programs which provide 'java'.
  Selection    Command
-----------------------------------------------
*+ 1           /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
   2           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
   3           /usr/java/latest/bin/java
Enter to keep the current selection[+], or type selection number: 3
# java -version
java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30)
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)



For jre;

export JAVA_HOME="/usr/java/jre1.6.0/bin"
export JAVA_PATH="$JAVA_HOME"
export PATH="$PATH:$JAVA_HOME"

For jdk;

export JAVA_HOME="/usr/java/jdk1.6.0/jre/bin"
export JAVA_PATH="$JAVA_HOME"
export PATH="$PATH:$JAVA_HOME"


When done creating or editing the file type; 

source /etc/profile.d/java.sh

Now any user root or other wise should be able to use the command;

which java

and the results should read something like;

/usr/bin/java


PS: If you want to load the environment variables within java.sh without having to restart the machine, you can use the source command as in:
$> source java.sh


Sunday, May 20, 2012

How can git be installed on CENTOS 5.5?




From source? From the repos? The easiest way is to use the repos: sudo yum install git should do it.
If you want to install from source, you can try these instructions. If you have yum-utils installed it's actually easier than that, too**:
sudo yum build-dep git
wget wget http://kernel.org/pub/software/scm/git/.tar.gz
tar -xvjf .tar.gz
cd 
make (possibly a ./configure before this)
sudo make install
**Substitute the portions enclosed in <> with the paths you need. Exact procedure may vary slightly as I have not compiled git from source, personally (there may be a configure script, for example). If you have no idea what I'm talking about, then you may want to just install from the repo as per my first suggestion.




[root@www local]# sudo yum install git
Loaded plugins: fastestmirror, priorities
Determining fastest mirrors
 * base: mirrors.serveraxis.net
 * extras: mirror.steadfast.net
 * jpackage-generic: sunsite.informatik.rwth-aachen.de
 * jpackage-generic-updates: sunsite.informatik.rwth-aachen.de
 * rpmforge: mirror.us.leaseweb.net
 * updates: mirror.wiredtree.com
addons                                                   | 1.9 kB     00:00
addons/primary_db                                        | 1.1 kB     00:00
base                                                     | 1.1 kB     00:00
base/primary                                             | 1.2 MB     00:00
base                                                                  3591/3591
extras                                                   | 2.1 kB     00:00
extras/primary_db                                        | 177 kB     00:00
jpackage-generic                                         | 2.3 kB     00:00
jpackage-generic/primary_db                              | 1.0 MB     00:01
jpackage-generic-updates                                 | 2.3 kB     00:00
jpackage-generic-updates/primary_db                      |  12 kB     00:00
rpmforge                                                 | 1.9 kB     00:00
rpmforge/primary_db                                      | 6.8 MB     00:04
updates                                                  | 1.9 kB     00:00
updates/primary_db                                       | 376 kB     00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
--> Processing Dependency: git = 1.7.6.1-1.el5.rf for package: git-daemon
--> Processing Dependency: git = 1.7.6.1-1.el5.rf for package: perl-Git
---> Package git.x86_64 0:1.7.10.1-1.el5.rf set to be updated
--> Running transaction check
---> Package git-daemon.x86_64 0:1.7.10.1-1.el5.rf set to be updated
---> Package perl-Git.x86_64 0:1.7.10.1-1.el5.rf set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package           Arch          Version                  Repository       Size
================================================================================
Updating:
 git               x86_64        1.7.10.1-1.el5.rf        rpmforge        8.0 M
Updating for dependencies:
 git-daemon        x86_64        1.7.10.1-1.el5.rf        rpmforge        317 k
 perl-Git          x86_64        1.7.10.1-1.el5.rf        rpmforge         28 k

Transaction Summary
================================================================================
Install       0 Package(s)
Upgrade       3 Package(s)

Total download size: 8.3 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): perl-Git-1.7.10.1-1.el5.rf.x86_64.rpm             |  28 kB     00:00
(2/3): git-daemon-1.7.10.1-1.el5.rf.x86_64.rpm           | 317 kB     00:00
(3/3): git-1.7.10.1-1.el5.rf.x86_64.rpm                  | 8.0 MB     00:00
--------------------------------------------------------------------------------
Total                                           6.4 MB/s | 8.3 MB     00:01
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating       : git                                                      1/6
  Updating       : perl-Git                                                 2/6
  Updating       : git-daemon                                               3/6
  Cleanup        : git-daemon                                               4/6
  Cleanup        : perl-Git                                                 5/6
  Cleanup        : git                                                      6/6

Updated:
  git.x86_64 0:1.7.10.1-1.el5.rf

Dependency Updated:
  git-daemon.x86_64 0:1.7.10.1-1.el5.rf   perl-Git.x86_64 0:1.7.10.1-1.el5.rf

Complete!