SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV Linux
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Linux Discussion related to the SageTV Media Center for Linux. Questions, issues, problems, suggestions, etc. relating to the SageTV Linux should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-23-2008, 09:45 AM
Zervun Zervun is offline
Sage User
 
Join Date: Jan 2008
Posts: 64
Howto: Install Java correctly for sage

After stumbling around this in the past, and getting a few PM's on it I thought I would make a readme.

This information extended from bastafidli's thread (much credit to him) http://forums.sagetv.com/forums/showthread.php?t=29968 and the link in that thread http://www.howtoforge.com/installati...5.1-desktop-p7

Linux is kind of an eye sore with java. Many distros don't come with an up to date java, due to Sun licensing. One of these is debian, Centos is the same way. Centos provides rpm's but I've never found them to be good with java

Some Comments -

Quote:
from bastafidli:
Maybe the first step should be to uninstall gjc or to do not install gjc in the first place when installing Linux. I have never found any real use for it and since we are going to install full Java anyway, it is not needed.
Quote:
from stuckless:
Under ubuntu # sudo apt-get installl sun-java6-jre
Quote:
from Chip33az:
I know in Etch, one can install sun-java5-jre (I had main contrib and non-free enabled).
I have added the backports.org repository and they have sun-java6-jre (I think it is 1.6.06).
FYI on backports under debian (not tested by myself but Chip33az has)

# vi /etc/apt/sources.list.

add - deb http://www.backports.org/debian etch-backports main contrib non-free

# apt-get update

-- Note: All backports are disable by default - if you want to install something from backports

apt-get -t etch-backports install “package”

or under aptitude

aptitude -t etch-backports install “package”



first off - this is on a default debian install - etch

#java-version

java version "1.4.2"
gij (GNU libgcj) version 4.1.2 20061115 (prerelease) (Debian 4.1.1-20)

1.4.2 is way old - we are going to grab a newer one

Download Java JRE for linux from http://java.sun.com - you do NOT want the rpm, and you want 32 bit if there is an option

I'm going to grab 1.5.0 update 15 - it downloads as jre-1_5_0_15-linux-i586.bin

#chmod +x jre-1_5_0_15-linux-i586.bin
#./jre-1_5_0_15-linux-i586.bin

hit spacebar a few times it will ask you to say yes, and then will extract to a directory - lets then move it to /opt because we installed sage there probably

#mv jre1.5.0_15/ /opt

-------Read this for going full system install of java between the marks if not skip beyond (have only succesfully done this on Centos not Debian base)--------

This is Centos steps and I have not successfully figured this out as there is no /etc/profile.d in debian that I can find just /etc/profile in debian etc, so if you are successful in debian do share

You will notice, that well this didn't override system settings for java - java-version still shows the old one - you don't really need your system completely updated, but if you do hit up http://www.howtoforge.com/installati...5.1-desktop-p7 on 7.1.3 Sun Java JRE about half way down the page. You are going to have to edit profile.d/java.sh, as well as alternatives install.

Here is a brief synopsis

link it to mozilla

#ln -s /opt/jre1.5.0_15/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins/

#vi /etc/profile.d/java.sh

add or adjust (it's a blank file most of the time)

export J2RE_HOME=/opt/jre1.5.0_15
export PATH=$J2RE_HOME/bin:$PATH

#source /etc/profile.d/java.sh
#alternatives --install /usr/bin/java java /opt/jre1.5.0_15/bin/java 2
#/usr/sbin/alternatives --config java

Select the new JRE

#2

Check to make sure it is ok

#/usr/sbin/alternatives --display java

and

#java-version

you should now see your new version

--------------END FULL SYSTEM JAVA INSTALL-----------------------

Ok - so if you did the above full system install, you can probably just run java as normal - if not follow these steps, as default java will still be pointing at 1.4.2

#vi /opt/sagetv/server/kegen.sh

under #!/bin/bash

PATH=/opt/jre1.5.0_15/bin:$PATH
export PATH

#vi /opt/sagetv/server/startsage.sh

PATH=/opt/jre1.5.0_15/bin:$PATH
export PATH

This will have sage use the jre1.5.0, if you want to try different versions just adjust.

I found that if I didn't do it to the keygen it would report encryption errors on registering your key

Last edited by Zervun; 05-23-2008 at 11:37 AM.
Reply With Quote
  #2  
Old 05-23-2008, 10:45 AM
bastafidli bastafidli is offline
Sage Expert
 
Join Date: Dec 2007
Location: Charlottesville, VA
Posts: 728
Maybe the first step should be to uninstall gjc or to do not install gjc in the first place when installing Linux. I have never found any real use for it and since we are going to install full Java anyway, it is not needed.
Reply With Quote
  #3  
Old 05-23-2008, 11:14 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Personally, if your distro has a java package for a recent jre, then I'd use that package first. It'll be easier to maintain the long run.

Ubuntu 8.04 (and even earlier releases) had fairly recent java packages.

Code:
# sudo apt-get installl sun-java6-jre
Reply With Quote
  #4  
Old 05-23-2008, 11:16 AM
Zervun Zervun is offline
Sage User
 
Join Date: Jan 2008
Posts: 64
Quote:
Originally Posted by stuckless View Post
Personally, if your distro has a java package for a recent jre, then I'd use that package first. It'll be easier to maintain the long run.

Ubuntu 8.04 (and even earlier releases) had fairly recent java packages.

Code:
# sudo apt-get installl sun-java6-jre
Ya, ubuntu is an exception, debian doesn't have it, and Centos/Redhat/Suse seen to have rpm's after the fact

This way allows to test multiple java instances though which is nice
Reply With Quote
  #5  
Old 05-23-2008, 11:19 AM
Zervun Zervun is offline
Sage User
 
Join Date: Jan 2008
Posts: 64
Quote:
Originally Posted by bastafidli View Post
Maybe the first step should be to uninstall gjc or to do not install gjc in the first place when installing Linux. I have never found any real use for it and since we are going to install full Java anyway, it is not needed.
The full install would definately be ideal, I just can't figure out the java.sh and profile.d locations in debian.

I'm actually a Centos man, my next task is to 64 bit it, and get Kmod with XFS.

I tried debian for just cross knowledge and also XFS out of the box. Ubuntu is a bit to cutting edge for my linux tastes but seems like easier out of the box.

My intention is to get some install instructions on each OS in 64 bit in the future you inspired me bastafidli

I run a commercial Centos 5.0 server, so thats the one I really want =)
Reply With Quote
  #6  
Old 05-23-2008, 11:28 AM
chip33az chip33az is offline
Sage User
 
Join Date: Nov 2006
Posts: 66
I thought Debian did have it.

I know in Etch, one can install sun-java5-jre (I had main contrib and non-free enabled).

I have added the backports.org repository and they have sun-java6-jre (I think it is 1.6.06).

Of course, my machine isn't working right now, so I don't know if the backports java works right
Reply With Quote
  #7  
Old 05-23-2008, 11:33 AM
Zervun Zervun is offline
Sage User
 
Join Date: Jan 2008
Posts: 64
Going to keep adding your guys's comments on the first post - it's nice getting all this info
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sage6 install craters windows firewall gateslinger SageTV Software 1 12-26-2006 05:39 PM
Java question matrix35 General Discussion 0 12-04-2006 04:12 PM
Java problem with AwtToolkit Ctrl-Z SageTV Beta Test Software 0 11-01-2005 09:32 AM
Java Runtime - Fresh Install Error greggerm SageTV Software 10 03-04-2004 07:17 AM
java install error 1722 batorok SageTV Beta Test Software 2 02-26-2004 10:20 AM


All times are GMT -6. The time now is 12:31 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.