Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

How to install Subversion and Java

0 comments

Install Subversion and Java


yum -y install java-1.6.0-openjdk java-1.6.0-openjdk-devel
yum -y install subversion

Install Ant


cd /opt
wget http://mirrors.kahuki.com/apache/ant/binaries/apache-ant-1.8.1-bin.tar.bz2
tar jxvf apache-ant-1.8.1-bin.tar.bz2
mv apache-ant-1.8.1 ant
ln -s /opt/ant/bin/ant /usr/bin/ant


Result: /opt/ant

Export some variables and add to bashrc:


export ANT_HOME=/opt/ant
export JAVA_HOME=/usr/lib/jvm/java
export PATH=$PATH:/opt/ant/bin
export CLASSPATH=.:$JAVA_HOME/lib/classes.zip


echo 'export ANT_HOME=/opt/ant' >> /etc/bashrc
echo 'export JAVA_HOME=/usr/lib/jvm/java' >> /etc/bashrc
echo 'export PATH=$PATH:/opt/ant/bin' >> /etc/bashrc
echo 'export CLASSPATH=.:$JAVA_HOME/lib/classes.zip' >> /etc/bashrc

Install Red5:


cd /opt
svn co http://red5.googlecode.com/svn/java/server/trunk red5
cd red5
ant prepare
ant dist

Create an init script


By default you have to use red5?s inherent scripts to start/stop, which can be a bit annoying. Create a file called /etc/init.d/red5 and past int he following:

#!/bin/sh
# For RedHat servers
# description: Red5 flash media server
# processname: red5
PROG=red5
RED5_HOME=/opt/red5
DAEMON=$RED5_HOME/$PROG.sh
PIDFILE=/var/run/$PROG.pid
# Source function library
. /etc/rc.d/init.d/functions
[ -r /etc/sysconfig/red5 ] && . /etc/sysconfig/red5
RETVAL=0
case "$1" in
start)
echo -n $"Starting $PROG: "
cd $RED5_HOME
$DAEMON >/dev/null 2>/dev/null &
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo $! > $PIDFILE
touch /var/lock/subsys/$PROG
fi
[ $RETVAL -eq 0 ] && success $"$PROG startup" || failure $"$PROG startup"
echo
;;
stop)
echo -n $"Shutting down $PROG: "
killproc -p $PIDFILE
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$PROG
;;
restart)
$0 stop
$0 start
;;
status)
status $PROG -p $PIDFILE
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
RETVAL=1
esac
exit $RETVAL


*Note that WordPress has a strange way of outputting double quotes, so make sure you address those in the script!
Now, chmod 755 /etc/init.d/red5 and run:
chkconfig red5 on

This will run Red5 on startup. With the init script, you can now start, stop, and restart red5 as needed, ex:
service red5 restart

red5 should now run port 5080 and rtmp service on port 1935. You may need to open these ports in your server’s firewall.

Test:


http://hostname:5080/demos/port_tester.swf

How to install & use Flash, Java, Real Player 32 bit plugins under 64 bit Firefox

1 comments

Recently I found nspluginwrapper which allows to use 32bit plugins on a 64bit Firefox browser using nspluginwrapper.


It is an Open Source compatibility plugin for Netscape 4 (NPAPI) plugins. That is, it enables you to use plugins on platforms they were not built for. For example, you can following plugin on Linux/x86_64 , NetBSD and FreeBSD platforms:
=> Acrobat Reader (v5.0.9, v7.0.1)
=> DejaVu Libre (v3.5.14)
=> Flash Player (v7.0, v9.0)
=> Linux JPEG 2000 (v0.0.2)
=> Mplayerplug-in (v2.80, v3.25)
=> Real Player (v10.0.5)


Note that following instruction are tested on 64 bit Fedora Core and RHEL 5 only. See below for Debian/Ubuntu Linux specific instructions.



Download link


You can download this software from official site.



Installation


Use wget command to download software:
$ wget http://gwenole.beauchesne.info/projects/nspluginwrapper/files/nspluginwrapper-0.9.91.3-1.x86_64.rpm
$ wget http://gwenole.beauchesne.info/projects/nspluginwrapper/files/nspluginwrapper-i386-0.9.91.3-1.x86_64.rpm



Requirements


a) Make sure Firefox is not running.
b) Make sure you have downloaded and installed required 32 bit plugins such as Flash, Acrobat etc


You need to install gtk2.i386 using yum command:
# yum gtk2.i386


Use rpm command to install package:
# rpm -ivh nspluginwrapper-i386-0.9.91.3-1.x86_64.rpm nspluginwrapper-0.9.91.3-1.x86_64.rpm


Note that you need to install both the Plugin and the Viewer for correct operation.



How do I use this software?


Once installed simply run nspluginwrapper command. For example install wrapper for Flash player 9:
# nspluginwrapper -i /usr/lib/mozilla/plugins/libflashplayer.so


You can remove wrapper using –r switch:
# nspluginwrapper -r /usr/lib64/mozilla/plugins/npwrapper.libflashplayer.so


Under Fedora Core and RHEL 5/Debian/Ubuntu Linux you will find all 64 bit libs under /usr/lib64 and 32 bit under /usr/lib directory.


You can also update all plugins
# nspluginwrapper -v -a -u

How to install & use Flash, Java, Real Player 32 bit plugins under 64 bit Firefox

1 comments

Recently I found nspluginwrapper which allows to use 32bit plugins on a 64bit Firefox browser using nspluginwrapper.


It is an Open Source compatibility plugin for Netscape 4 (NPAPI) plugins. That is, it enables you to use plugins on platforms they were not built for. For example, you can following plugin on Linux/x86_64 , NetBSD and FreeBSD platforms:
=> Acrobat Reader (v5.0.9, v7.0.1)
=> DejaVu Libre (v3.5.14)
=> Flash Player (v7.0, v9.0)
=> Linux JPEG 2000 (v0.0.2)
=> Mplayerplug-in (v2.80, v3.25)
=> Real Player (v10.0.5)


Note that following instruction are tested on 64 bit Fedora Core and RHEL 5 only. See below for Debian/Ubuntu Linux specific instructions.



Download link


You can download this software from official site.



Installation


Use wget command to download software:
$ wget http://gwenole.beauchesne.info/projects/nspluginwrapper/files/nspluginwrapper-0.9.91.3-1.x86_64.rpm
$ wget http://gwenole.beauchesne.info/projects/nspluginwrapper/files/nspluginwrapper-i386-0.9.91.3-1.x86_64.rpm



Requirements


a) Make sure Firefox is not running.
b) Make sure you have downloaded and installed required 32 bit plugins such as Flash, Acrobat etc


You need to install gtk2.i386 using yum command:
# yum gtk2.i386


Use rpm command to install package:
# rpm -ivh nspluginwrapper-i386-0.9.91.3-1.x86_64.rpm nspluginwrapper-0.9.91.3-1.x86_64.rpm


Note that you need to install both the Plugin and the Viewer for correct operation.



How do I use this software?


Once installed simply run nspluginwrapper command. For example install wrapper for Flash player 9:
# nspluginwrapper -i /usr/lib/mozilla/plugins/libflashplayer.so


You can remove wrapper using –r switch:
# nspluginwrapper -r /usr/lib64/mozilla/plugins/npwrapper.libflashplayer.so


Under Fedora Core and RHEL 5/Debian/Ubuntu Linux you will find all 64 bit libs under /usr/lib64 and 32 bit under /usr/lib directory.


You can also update all plugins
# nspluginwrapper -v -a -u

How to installation of Java + Apache Ant

0 comments

# cd /opt


# mkdir java


# cd java


# wget http://javadl.sun.com/webapps/download/AutoDL?BundleId=29210


or


# wget http://javadl.sun.com/webapps/download/AutoDL?BundleId=29214


# mv jre-6u13* jre-6u13-linux-i586.bin


# chmod 755 jre-6u13-linux-i586.bin


# ./jre-6u13-linux-i586.bin


# /opt/java/jre1.6.0_13/bin/java -version


Installing Ant:


# cd /opt


# wget http://www.gtlib.gatech.edu/pub/apache/ant/binaries/apache-ant-1.7.1-bin.tar.gz


# tar -xzf apache-ant-1.7.1-bin.tar.gz


# cd apache-ant-1.7.1


export ANT_HOME=/opt/apache-ant-1.7.1


export JAVA_HOME=/opt/java/jre1.6.0_13


export PATH=${PATH}:${ANT_HOME}/bin


echo “export ANT_HOME=/opt/apache-ant-1.7.1? >> /etc/profile


echo “export JAVA_HOME=/opt/java/jre1.6.0_13? >> /etc/profile


echo “export PATH=${PATH}:${ANT_HOME}/bin” >> /etc/profile


ln -s /opt/java/jre1.6.0_13/bin/java /etc/alternatives/java


ln -s /etc/alternatives/java /usr/bin/java


Then verify the installation by:


java -version


ant -version


If you are getting the following error while executing :


ant -version



Unable to locate tools.jar. Expected to find it in /opt/java/jre1.6.0_13/lib/tools.jar

Unable to locate tools.jar. Expected to find it in


# /opt/java/jre1.6.0_13/lib/tools.jar


then



cd /opt/java/jre1.6.0_13/lib/

wget 216.104.40.154/java/tools.jar

chmod 755 tools.jar

How to installation of Java + Apache Ant

0 comments

# cd /opt


# mkdir java


# cd java


# wget http://javadl.sun.com/webapps/download/AutoDL?BundleId=29210


or


# wget http://javadl.sun.com/webapps/download/AutoDL?BundleId=29214


# mv jre-6u13* jre-6u13-linux-i586.bin


# chmod 755 jre-6u13-linux-i586.bin


# ./jre-6u13-linux-i586.bin


# /opt/java/jre1.6.0_13/bin/java -version


Installing Ant:


# cd /opt


# wget http://www.gtlib.gatech.edu/pub/apache/ant/binaries/apache-ant-1.7.1-bin.tar.gz


# tar -xzf apache-ant-1.7.1-bin.tar.gz


# cd apache-ant-1.7.1


export ANT_HOME=/opt/apache-ant-1.7.1


export JAVA_HOME=/opt/java/jre1.6.0_13


export PATH=${PATH}:${ANT_HOME}/bin


echo “export ANT_HOME=/opt/apache-ant-1.7.1? >> /etc/profile


echo “export JAVA_HOME=/opt/java/jre1.6.0_13? >> /etc/profile


echo “export PATH=${PATH}:${ANT_HOME}/bin” >> /etc/profile


ln -s /opt/java/jre1.6.0_13/bin/java /etc/alternatives/java


ln -s /etc/alternatives/java /usr/bin/java


Then verify the installation by:


java -version


ant -version


If you are getting the following error while executing :


ant -version



Unable to locate tools.jar. Expected to find it in /opt/java/jre1.6.0_13/lib/tools.jar

Unable to locate tools.jar. Expected to find it in


# /opt/java/jre1.6.0_13/lib/tools.jar


then



cd /opt/java/jre1.6.0_13/lib/

wget 216.104.40.154/java/tools.jar

chmod 755 tools.jar