Special web hosting offer - LIMITED TIME ONLY

Aug 02
1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 4.5 out of 5)
Loading ... Loading ...

Java JRE LogoI wanted the latest version of Sun’s JRE installed on my system, and to have it set up as the default Java Runtime Environment whenever I ran a Java executable, or Jar file. It’s actually a pretty easy process, so this is a relatively short tutorial, but I’ll cover both the 32 bit and 64 bit installations, since aside from differences in file names, the set up is identical.

Installing JRE

First, decide on which architecture will be installed, and download the relevant file from the main Java website. At the time of writing, 1.6.0 u7 can be downloaded from the following: 32 bit, and 64 bit. I wanted to install the x64 version, and so downloaded jre-6u7-linux-x64.bin to my Desktop. I also wanted to install it in its own directory in /usr, and so created a directory for it to sit in:

cd /usr
sudo mkdir java

I was also experimenting with the 32 and 64 bit versions, so made two extra directories within java:

cd java
mkdir 32 64

and, since I’m the only user of the system, for my own convenience (I’m just too lazy to type “sudo” sometimes…) changed the ownership to my user, as opposed to root:

sudo chown myuser:mygroup 32 64

I then copied the relevant file(s) to the respective directories, and made them executable:

32 bit:

cp ~/Desktop/jre-6u7-linux-i586.bin /usr/java/32
chmod 755 /usr/java/32/jre-6u7-linux-i586.bin

64 bit:

cp ~/Desktop/jre-6u7-linux-x64.bin /usr/java/64
chmod 755 /usr/java/64/jre-6u7-linux-x64.bin

The final part of the installation simply involves executing the binary file:

32 bit:

cd /usr/java/32
./jre-6u7-linux-i586.bin

64 bit:

cd /usr/java/64
./jre-6u7-linux-x64.bin

Regardless of architecture, this should create a sub directory called jre1.6.0_07.

Setting JRE 1.6.0 u7 as Default

The process simply involves telling the system that there is an alternative Java binary available, and to use this binary to execute an “java” commands:

32 bit:

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/java/32/jre1.6.0_07/bin/java" 1
sudo update-alternatives --set java /usr/java/32/jre1.6.0_07/bin/java

64 bit:

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/java/64/jre1.6.0_07/bin/java" 1
sudo update-alternatives --set java /usr/java/64/jre1.6.0_07/bin/java

Follwing the second command, there should be output to the terminal something along the lines of:

Using '/usr/java/32/jre1.6.0_07/bin/java' to provide 'java'.

or,

Using '/usr/java/64/jre1.6.0_07/bin/java' to provide 'java'.

depending on the architecture installed. That’s it. Now every time “java” is run, either explicitly from the Terminal, or via a Java executable (such as the Eclipse IDE), Ubuntu will use the newly installed /usr/java/64/jre1.6.0_07/bin/java binary as opposed to the binary installed by default. Simple, eh?


written by Hodge \\ tags: ,

Apr 30
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Azureus LogoI love the fact that a huge amount of the applications I regularly use are available via the package manager, but sometimes, I like to install applications myself. Azureus is one such application - I wanted to install the latest x64 version, and utilise the x64 JRE I had installed for the x64 Eclipse IDE. Of course, it can easily be installed by running

sudo apt-get install azureus

(in Ubuntu) and everything is done automatically. But, this is how I installed it.

I had already installed x64 JRE (see 64 Bit Eclipse: Linux Installation, including PDT, WTP (WST), ATF, and MySQL (SQL Explorer Plugin)), but for the benefit of those who haven’t, don’t want to read that particular article, or just can’t be arsed scanning through it, here’s the procedure again (skip to —END x64 JRE INSTALL— if you don’t want to read this part!)

The 64 Bit JRE can be downloaded here (or use the direct link to the bin file). After the file downloaded to my desktop, I opened up a new Terminal Window (Applications -> Accessories -> Terminal), traversed to the directory I wanted to install it into, moved the file, made it executable, and ran it to install:

cd /usr/java
sudo mkdir 64
cd 64
sudo mv ~/Desktop/jdk-6u5-linux-x64.bin /usr/java/64/
sudo chmod a+x jdk-6u5-linux-x64.bin
sudo ./jdk-6u5-linux-x64.bin

If the “java” directory doesn’t exist by the way, it needs to be created first:

sudo mkdir /usr/java

Anyway, listing the directory

ls

should return

jre1.6.0_05

which is the directory containing the necessary Java binaries.

—END x64 JRE INSTALL—

The 64 Bit version of Azureus (currently v3.5.0.2) can be downloaded here. Once the archive had downloaded to my desktop, I unpacked it:

cd ~/Desktop
tar -xjvf Azureus_3.0.5.2_linux-x86_64.tar.bz2

As usual, I like to put applications (which don’t need compiling and installing) into /opt

sudo mv azureus /opt

Within the /opt/azureus folder, is a shell script for running the Azureus client called, funnily enough, azureus. However, to get it working with the 64 Bit JRE I had installed, I had to make a couple of minor adjustments to the script:

cd /opt/azureus
gksu gedit azureus

Line 5 contains a variable for the Java program directory:

JAVA_PROGRAM_DIR=""

so, I simply inserted the path to the JRE bin directory:

JAVA_PROGRAM_DIR="/usr/java/64/jre1.6.0_05/bin/"

saved the script, and closed the editor. I can now run the Azureus client by running this script:

/opt/azureus/azureus

Alternatively, it can be run from the Applications menu by creating an entry pointing to /opt/azureus/azureus - open System -> Preferences -> Main Menu, highlight “Internet”, and click “New Item”. Enter “Azureus” for the name, /opt/azureus/azureus for the Command, and change the icon to the Azureus logo by clicking on the Icon, and browsing to /opt/azureus/azureus, which will automatically list the images in the folder to choose from.


written by Hodge \\ tags: , , ,

Webloogle Blog Directory