Difference between revisions of "Java 1.5: Debian Make and Install"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
m
 
(48 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
== Introduction ==
 
== Introduction ==
The purpose of this project is to have a place to archive TV shows recorded via ReplayTV and still be able to access them by browsing to the Kurobox from any ReplayTV on your LAN. I personally have this running on my LAN and it works flawlessly!  Keep in mind, you will need at least an HG model for this to work reliably.  A standard Kurobox will work with very mixed results.
+
The purpose of this project is to create a Debian package of Java 1.5 so that it can be managed better than installing it manually.
  
The following set of instructions is assuming you will be starting from scratch on a Kurobox…let’s get started!
+
== Assumptions ==
  
 +
* Debian is already installed
  
== Install Debian ==
+
* Kurobox is accessible via FTP
  
* Follow steps spelled out [http://www.kurobox.com/mwiki/index.php/Debian_install here]
+
* [http://nas-central.org/index.php?title=Articles/DebianKeyPackages Key Debian packages] are already installed
  
* Use the latest Kurobox Debian image from [http://genbako.vodapone.com/ here] (Be sure to select the correct download for your Kurobox [HG vs non-HG])
+
== Needed Files ==
 +
=== IBM Java for PPC ===
 +
http://www-128.ibm.com/developerworks/java/jdk/linux/download.html,
 +
 
 +
Select 32-bit iSeries/pSeries J2SE 5.0.  As of writing this, the latest version is SR4.  I'm not aware of anyway to detect what version is installed so just make a mental note of the service release number in case an update is needed for later.  Yes, you will need to register to download this and yes, its a pain.  When you finally reach the download page, download the .tgz version of the JRE.
 +
 
 +
On the Kurobox, create directory /opt and do a chmod on it
 +
 
 +
# mkdir /opt
 +
# chmod 777 /opt
 +
 
 +
Upload the .tgz file into the /opt directory and then do the following:
 +
 
 +
# chmod 777 /opt/ibm-java2-jre-5.0-4.0-linux-ppc.tgz
 +
 
 +
=== Java-Package ===
 +
 
 +
When you do an apt-get install java-package, you will get the latest "stable" version which is 0.24.  Unfortunately, 0.24 is not able to make a Java 1.5 .deb file from IBM.  (Specifically, the ibm-j2re.sh file does not have the parameters for it).  Go ahead and get [http://debian.lcs.mit.edu/debian/pool/contrib/j/java-package/java-package_0.28_all.deb version 0.28]([http://archive.ubuntu.com/ubuntu/pool/multiverse/j/java-package/java-package_0.27_all.deb Version 0.27] works as well.)
 +
 
 +
Upload to the Kurobox and do the following as root:
 +
 
 +
# dpkg -i java-package_0.27_all.deb
 +
 
 +
or
 +
 
 +
# dpkg -i java-package_0.28_all.deb
 +
 
 +
depending on which one you use
 +
 
 +
 
 +
You can verify the version of java-package you have installed by typing
 +
 
 +
# apt-cache policy java-package
 +
 
 +
Should look something like this:
 +
java-package:
 +
  Installed: 0.27
 +
  Candidate: 0.27
 +
  Version Table:
 +
*** 0.27 0
 +
        100 /var/lib/dpkg/status
 +
    0.24 0
 +
        500 ftp://ftp.dti.ad.jp stable/contrib Packages
 +
 +
Remember that java file we downloaded from IBM?  Java-Package does not recognize the file name that IBM gives it so we need to rename it to a more general name that it recognizes.
 +
 
 +
# mv /opt/ibm-java2-jre-5.0-4.0-linux-ppc.tgz /opt/ibm-java2-jre-50-linux-ppc.tgz
 +
 
 +
=== fakeroot ===
 +
 
 +
# apt-get install fakeroot
 +
 
 +
Nuff said
 +
 
 +
== Preparing the Kurobox for brewing Java 1.5 ==
 +
At this point one could just and make the .deb package and see if it will work.  However, there will be a plethora of warnings about not being to able find paths of various packages.  So, to satisfy the make process without any warnings, install the following:
 +
 
 +
# apt-get install libgtk1.2 libxp6 libxtst6 libxt6 libgtk2.0-0 libglib2.0-0 libxmu6 unixodbc
 +
 
 +
It's been said on another [http://www.debianhelp.co.uk/debianjava.htm Debian help page] that the warnings mentioned above may not necessarily be a bad thing.  As long as the .deb package is created, it ''should'' still work.
 +
 
 +
== Making Debian Java ==
 +
 
 +
Make sure you are not root when doing this next step.  In the /opt directory type:
 +
 
 +
# fakeroot make-jpkg ibm-java2-jre-50-linux-ppc.tgz
 +
 
 +
Be patient, it will take some time for the Kurobox to create the .deb package.  If all went well, there should be a new file called '''ibm-j2re1.5_1.5.0_powerpc.deb''' in /opt.
 +
 
 +
== Install and Verify ==
 +
 
 +
As root and still in the /opt directory type:
 +
 
 +
# dpkg -i ibm-j2re1.5_1.5.0_powerpc.deb
 +
 
 +
The .deb install doesn't take very long.  Once you have a prompt back type the following to make sure you have 1.5 installed
 +
 
 +
# java -version
 +
 
 +
== Multiple Versions Installed ==
 +
 
 +
If you have multiple JRE or JDK installed (e.g. 1.5.0 and 1.4.2) and want/need to switch between them, you can use update-alternatives to do so.
 +
 
 +
Example: Choosing which java executable to use:
 +
 
 +
# update-alternatives --config java
 +
 
 +
Example: Choosing which javac executable to use:
 +
 
 +
# update-alternatives --config javac
 +
 
 +
And so on in that fashion for the remaining executables related to Java. You can look in /etc/alternatives to see what one can configure with update-alternatives.
 +
 
 +
== Removing Java 1.5 ==
 +
 
 +
If it ever comes to where you need to remove Java 1.5, issue the following command:
 +
 
 +
# apt-get remove ibm-j2re1.5
 +
 
 +
== Knowledge Well ==
 +
https://help.ubuntu.com/community/Java
 +
 
 +
http://www.debianhelp.co.uk/debianjava.htm
 +
 
 +
{{Template:Articles|Kurobox|Debian}}

Latest revision as of 01:43, 11 September 2007

Contents

Introduction

The purpose of this project is to create a Debian package of Java 1.5 so that it can be managed better than installing it manually.

Assumptions

  • Debian is already installed
  • Kurobox is accessible via FTP

Needed Files

IBM Java for PPC

http://www-128.ibm.com/developerworks/java/jdk/linux/download.html,

Select 32-bit iSeries/pSeries J2SE 5.0. As of writing this, the latest version is SR4. I'm not aware of anyway to detect what version is installed so just make a mental note of the service release number in case an update is needed for later. Yes, you will need to register to download this and yes, its a pain. When you finally reach the download page, download the .tgz version of the JRE.

On the Kurobox, create directory /opt and do a chmod on it

# mkdir /opt
# chmod 777 /opt

Upload the .tgz file into the /opt directory and then do the following:

# chmod 777 /opt/ibm-java2-jre-5.0-4.0-linux-ppc.tgz

Java-Package

When you do an apt-get install java-package, you will get the latest "stable" version which is 0.24. Unfortunately, 0.24 is not able to make a Java 1.5 .deb file from IBM. (Specifically, the ibm-j2re.sh file does not have the parameters for it). Go ahead and get version 0.28. (Version 0.27 works as well.)

Upload to the Kurobox and do the following as root:

# dpkg -i java-package_0.27_all.deb

or

# dpkg -i java-package_0.28_all.deb

depending on which one you use


You can verify the version of java-package you have installed by typing

# apt-cache policy java-package

Should look something like this:

java-package:
 Installed: 0.27
 Candidate: 0.27
 Version Table:
*** 0.27 0
       100 /var/lib/dpkg/status
    0.24 0
       500 ftp://ftp.dti.ad.jp stable/contrib Packages

Remember that java file we downloaded from IBM? Java-Package does not recognize the file name that IBM gives it so we need to rename it to a more general name that it recognizes.

# mv /opt/ibm-java2-jre-5.0-4.0-linux-ppc.tgz /opt/ibm-java2-jre-50-linux-ppc.tgz

fakeroot

# apt-get install fakeroot

Nuff said

Preparing the Kurobox for brewing Java 1.5

At this point one could just and make the .deb package and see if it will work. However, there will be a plethora of warnings about not being to able find paths of various packages. So, to satisfy the make process without any warnings, install the following:

# apt-get install libgtk1.2 libxp6 libxtst6 libxt6 libgtk2.0-0 libglib2.0-0 libxmu6 unixodbc

It's been said on another Debian help page that the warnings mentioned above may not necessarily be a bad thing. As long as the .deb package is created, it should still work.

Making Debian Java

Make sure you are not root when doing this next step. In the /opt directory type:

# fakeroot make-jpkg ibm-java2-jre-50-linux-ppc.tgz

Be patient, it will take some time for the Kurobox to create the .deb package. If all went well, there should be a new file called ibm-j2re1.5_1.5.0_powerpc.deb in /opt.

Install and Verify

As root and still in the /opt directory type:

# dpkg -i ibm-j2re1.5_1.5.0_powerpc.deb

The .deb install doesn't take very long. Once you have a prompt back type the following to make sure you have 1.5 installed

# java -version

Multiple Versions Installed

If you have multiple JRE or JDK installed (e.g. 1.5.0 and 1.4.2) and want/need to switch between them, you can use update-alternatives to do so.

Example: Choosing which java executable to use:

# update-alternatives --config java

Example: Choosing which javac executable to use:

# update-alternatives --config javac

And so on in that fashion for the remaining executables related to Java. You can look in /etc/alternatives to see what one can configure with update-alternatives.

Removing Java 1.5

If it ever comes to where you need to remove Java 1.5, issue the following command:

# apt-get remove ibm-j2re1.5

Knowledge Well

https://help.ubuntu.com/community/Java

http://www.debianhelp.co.uk/debianjava.htm