ServerPronto Dedicated Servers
       ServerPronto Home   ServerPronto University     
ServerPronto University  

Support of the day: Install 32-bit Software on 64-bit OS


March 24th, 2011

This support solution is on installing a 32-bit app on a x64 system. Stated on the example of Java Development Kid installed on Fedora x64 bit.



There are three layers that are important when it comes to 32/64bit compatibility:

- Processor

- Operating System

- Application

A 32 bit OS will run on a 32 or 64 bit processor, without any problems.


A 32 bit software on a 64 bit OS works, but could cause difficulties even if the 64 bit systems are backward compatible with the 32 bit counterparts.


To run a 64 bit OS, you need support from its lower level (a 64 bit processor). Therefore a 64 bit OS does not work for a 32 bit CPU.


To run a 64 bit application, you need support from all lower levels (64 bit OS and 64 bit processor).

Linux commands:
Check your processor:

# cat /proc/cpuinfo

Check Kernel/System:

# uname -m



For our example, the perfect solution is to install a 64 bit version of JDK on the Fedora x64 bit operating system.

Here is the How-To-Do:

First thing we need to do is get the JDK installer
JDK Home from Oracle.com

Once we have the installer in our local repository (as root):

chmod a+x  jdk-6u21-linux-x64-rpm.bin./jdk-6u21-linux-x64-rpm.bin

Next, we must add these two lines to the file: /etc/profile

JAVA_HOME=/usr/java/jdk1.6.0_21
pathmunge $JAVA_HOME/jre/bin after

At the end of the line that starts with export, we need to add this our JAVA_HOME variable, so the line should be like this:

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC JAVA_HOME

Then, we need to execute the next statements. Hint: Copy all the lines like if were just one.

export JAVA_HOME=/usr/java/jdk1.6.0_21
export JAVA_ALTERNATIVE_PRIORITY=16021
/usr/sbin/update-alternatives --install /usr/bin/java java $JAVA_HOME/bin/java $JAVA_ALTERNATIVE_PRIORITY
/usr/sbin/update-alternatives --install /usr/bin/javadoc javadoc $JAVA_HOME/bin/javadoc $JAVA_ALTERNATIVE_PRIORITY
/usr/sbin/update-alternatives --install /usr/bin/appletviewer appletviewer $JAVA_HOME/bin/appletviewer $JAVA_ALTERNATIVE_PRIORITY
/usr/sbin/update-alternatives --install /usr/bin/javah javah $JAVA_HOME/bin/javah $JAVA_ALTERNATIVE_PRIORITY
/usr/sbin/update-alternatives --install /usr/bin/javac javac $JAVA_HOME/bin/javac $JAVA_ALTERNATIVE_PRIORITY
/usr/sbin/update-alternatives --install /usr/bin/jar jar $JAVA_HOME/bin/jar $JAVA_ALTERNATIVE_PRIORITY

Then, we export the alternatives:

/usr/sbin/update-alternatives --auto java
/usr/sbin/update-alternatives --auto javadoc
/usr/sbin/update-alternatives --auto appletviewer
/usr/sbin/update-alternatives --auto javah
/usr/sbin/update-alternatives --auto javac
/usr/sbin/update-alternatives --auto jar

To confirm that our installation is successfull:

java -version

Should give us an ouptput like this:

[root@yourMachine]# java -version
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)



Further information:
http://www.techsupportalert.com/content/32-bit-and-64-bit-explained.htm

http://wporta.wordpress.com/2010/07/06/installing-jdk-in-fedora-13/



Entry Filed under: Support of the day

 

Leave a Comment

hidden
Comment:

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed

 
Infolink ServerPronto Infolink Review Our Guarantee Why Choose ServerPronto? Why Choose ServerPronto? Review Our Guarantee Home About Why Choose ServerPronto? Compare Packages Frequently Asked Questions (FAQ) Order Now!