Installing Java in Tiny Core Linux

When it comes to installing Java in Tiny Core Linux, there are two options. You can either install the open source implementation of Java(OpenJDK) or install the official Java binary from Oracle. In this article I will show how to install any of these Java flavors in your Tiny Core Linux installation. For the example below I use Tiny Core Linux 4.1 and Java 1.6. The steps are similar for other versions.

Click here for the detailed tutorial on installing Tiny Core Linux in a hard disk. This tutorial also sets the hard disk partition as the location for downloaded extensions. Please note that for Oracle Java installation, hard disk partition requires over 500MB of free space.

Installing OpenJDK in Tiny Core Linux

Installing OpenJDK 6 in Tiny Core Linux is easy since OpenJDK is part of the Tiny Core Linux extension repository. From the bottom menu bar, click on AppBrowser. This opens up the extension manager for Tiny Core Linux.

Installing extensions in Tiny Core Linux

Click on connect and then search for openjdk. Select openjdk-6-jdk.tcz and then click on the Go button on bottom left. It will take a while to install openjdk since the download size of the package is around 55MB. Note the location of the downloaded extension (/mnt/sda1/tce/optional). It points to the partition assigned for the tce boot code.

Installing OpenJDK in Tiny Core Linux

Restart Tiny Core Linux and run the following command to verify that Java is installed on TCL,

java -version

Finding Java Version

 

Installing Oracle Java 6 in Tiny Core Linux

Some people prefer to install Oracle Java since it is usually more stable and well tested with Java programs than OpenJDK. Also some of the applications only work with Oracle JDK.

Download Oracle Java binary file using wget command (from the home folder),

wget http://download.oracle.com/otn-pub/java/jdk/6u29-b11/jdk-6u29-linux-i586.bin

Now you may be wondering how I got the URL for the Java binary. Visit Oracle JDK download site and then click on download link for JDK 6. Accept the license agreement on the next page and then right click and copy the URL for the Linux x86.

Change the type of the downloaded file to an executable file,

chmod +x jdk-6u29-linux-i586.bin

Now extract the contents of the binary by running the binary file,

./jdk-6u29-linux-i586.bin

The Java files are extracted to the folder jdk1.6.0_29. During Tiny Core Linux installation, we had configured /opt and /home as persistent folders. Hence we will copy the JDK to /opt folder.

Create java folder,

cd /opt

mkdir /java

Go back to home folder and then move the JDK files extracted earlier to /opt/java,

cd

mv jdk1.6.0_29 /opt/java/

You can set the JAVA_HOME and path to Java binary permanently in the .ashrc file in the home folder (/home/tc),

cd

vi .ashrc

Add the following content to .ashrc,

export JAVA_HOME=/opt/java/jdk1.6.0_29
export PATH=$PATH:$JAVA_HOME/bin

Restart Tiny Core Linux. Run the following command to verify that Oracle Java is installed correctly on Tiny Core Linux.

java -version

Oracle Java in Tiny Core Linux

Click here to receive Distro Tips updates in your email. Confirm your subscription by clicking on the link sent to you by feedburner!

Comments

2 Responses to “Installing Java in Tiny Core Linux”
  1. Karthikeyan says:

    Great article! worked well for me. Thanks indeed!

Trackbacks

Check out what others are saying about this post...


Speak Your Mind