LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   j2re install (https://www.linuxquestions.org/questions/linux-software-2/j2re-install-145235/)

n_hendrick 02-12-2004 09:41 AM

j2re install
 
I'm having trouble getting java functionality in gnome under redhat 9.0, I've tried just about everything but for some reason java isn't even showing up in my other applications either, is there a path variable I have to change, or am I just hopeless. I've tried the binary executable and the rpm both give me no results.

nikolaus 02-12-2004 10:28 AM

jre installation / usage
 
Make sure that and where the jre is installed.
Has it been installed using the RPM, type
rpm -qa | grep -i jre
If something like "java2-jre-1.4.2" shows up, it is installed.

Now, ask the PRM database for the location the JRE files have been
installed to: rpm -ql java2-jre | more
You should find a subdirectory named "jre/bin" somewhere in the output.

Usually, a link "/usr/lib/java" is created during installation of the os and/or
java jre and points to the "right" directory.

If you installed by tar.gz package, use the "find" command to locate the packages installation location:

find /opt /usr -name "jre" -type d

Now when we are that an jre is installed, we check for a sufficient search path.

Log on as a simple "user" - avoid using the "root" account whenever possible. Type in
echo $PATH | grep java
You should find something like ":/usr/lib/java/jre/bin:" in the output. If, you should then try to call "java -version" and see output like this:

Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
...

If not, consider to download the Sun JRE RPM from http://java.sun.com/j2se/1.4.2/download.html.
(Locate the string "Download J2SE v 1.4.2_03" and click at the link "download" below the word "JRE". Read and accept the license agreement. Select "RPM in self-extracting file" for download.

Install that file as user "root"!

n_hendrick 02-12-2004 10:36 AM

thanks I'll try that.

n_hendrick 02-12-2004 11:01 AM

okay, I did the above....everythings installed and path is functioning but when I go to type java -version I get a 1.3.1 listing for gcj and it says java version 1.3.1 now when I go into the directory of java 1.4.2 and type java version I get Java Runtime 1.4.2, I don't know if this has anything to do with the browser and software problem or not, but the installed Java Runtime appears to be unaccessible, could I always uninstall the java gcj for RedHat 3.2 or should I try something else. I'm not sure how to get rid of this ancient java but is there anything else I can do?

nikolaus 02-13-2004 02:49 PM

You can uninstall the ancient java. Usually java programs coded for 1.3.x will run without any harm within the 1.4.x VM. A small (and shrinking) number of applets coded for jre 1.1 won't run within 1.3, 1.4 VM.

To set the default VM to "1.4.2", you need to set the link "/usr/lib/java" to the "right" VMs directory.

To demonstrate the dependancies, i prepared some lines of output from the command sequence "cd /usr/lib; ls -ld java SunJava*".
Here, the default VM is set to "1.3.1", since the link "java" points to the link "SunJava2-1.3" wich points to the directory "SunJava2-1.3.1".

lrwxrwxrwx 1 root root 12 Feb 8 01:47 SunJava2 -> SunJava2-1.3
lrwxrwxrwx 1 root root 14 Feb 7 23:51 SunJava2-1.3 -> SunJava2-1.3.1
lrwxrwxrwx 1 root root 14 Feb 7 23:51 SunJava2-1.4 -> SunJava2-1.4.2
drwxr-xr-x 3 root root 72 Feb 7 23:51 SunJava2-1.3.1
drwxr-xr-x 3 root root 72 Feb 7 23:51 SunJava2-1.4.2
lrwxrwxrwx 1 root root 14 Aug 11 2002 java -> SunJava2-1.3.1

To select "1.4.2" as default VM, i would log on as root and
call the following commands :

cd /usr/lib
rm -f java
ln -s SunJava2-1.4 java


The listing "ls -ld java SunJava*" then shows:

lrwxrwxrwx 1 root root 12 Feb 8 01:47 SunJava2 -> SunJava2-1.4
lrwxrwxrwx 1 root root 14 Feb 7 23:51 SunJava2-1.3 -> SunJava2-1.3.1
lrwxrwxrwx 1 root root 14 Feb 7 23:51 SunJava2-1.4 -> SunJava2-1.4.2
drwxr-xr-x 3 root root 72 Feb 7 23:51 SunJava2-1.3.1
drwxr-xr-x 3 root root 72 Feb 7 23:51 SunJava2-1.4.2
lrwxrwxrwx 1 root root 12 Feb 8 01:47 java -> SunJava2-1.4

There is a configuration file somewhere within /etc/sysconfig (at least when running SuSE), enabling the administrator to set the "default VM" as configuration statement. The systenm will take that setting during bootup. I don't know if RH has such a setting and where it would reside.

Good luck.

n_hendrick 02-14-2004 10:56 AM

thanks for all your guys' help.

stuzuk 02-14-2004 01:00 PM

I have installed java from a RPM I am using the Fedora Core and am very new to Linux.
I used the commands to see where the RPM is installed and the lcation is below.

/usr/java/jre1.3.1_10/

Java does not work and also has not come up in my plugins list in Mozilla 1.4.1

Please can someone assist me.

TIA

stuzuk 02-14-2004 06:25 PM

I installed this as a "USER" and not as "ROOT" as at the time I did not know how to log in as root I know that sounds silly but I am a Windows person whom crossed over a week ago.

Im really enjoying Fedora but need some assitance

I tryed to reinstall Java as "ROOT" but when I double click the RPM it says that it has been installed allready.

How do I unistall it? so that I can reinsatll whilst logged in as "ROOT"

stuzuk 02-15-2004 09:17 AM

All the information I needed was found here.

http://www.java.com/en/download/help/linux_install.jsp

D4RK5UN 03-02-2004 05:48 AM

Dern Java
 
..ok now I am unable to get Java j2re workin'(i use RH9)... I downloaded and installed an RPM from the Sun site but get still get the grey at the Java Console area, what is my problem ? Did I do, or not do something? :scratch:

D4RK5UN 03-02-2004 05:52 AM

BTW... I followed the directions straight from the JAva during my install. And when attepting a re-install my box says to me "package j2re-1.4.2_03-fcs is already installed". Hmmm

mkaman 03-05-2004 04:24 AM

I used the self-extracting package to install java in /usr/java/j2re<version> and then i added this to my path:
/usr/java/j2re<version>/bin
With this you can reach java, java_vm and jar from the comand line.

Then i created this file in the bin directory in the root of my user account:
---------------------------------------------------------------------------------
#!/bin/sh

export JAVA_HOME="/usr/java/j2re<version>"
export JAVA_PATH="$JAVA_HOME"
export PATH="$PATH:$JAVA_HOME/bin"
JDK_HOME="$JAVA_HOME"

-----------------------------------------------------------------------------------------
You can also put this file in the /bin directory to make this global.. You can easily change the version of java instaling a new one and modifing this file :D.

To get java into mozilla you only have to make a soft link (symbolic link) to the java plugin. Asuming you are in mozilla/plugins directory:

# ln -s /usr/java/j2re<version>/plugin/i386/ns610-gcc32/libjavaplugin_oji.so libjavaplugin_oji.so

I think this will work for j2re work (uninstall that rpms first and, of course, change <version> with your version :P)

mkaman 03-05-2004 05:18 AM

Taking a look in the instaled j2re i have noticed that it comes with java web start (javaws). This helps you to load fastly java aplications from the web like these we can see in this demo site:
http://java.sun.com/products/javawebstart/demos.html

Asuming j2re is instaled in /usr/java/j2re1.4.2_02 and the folder /usr/java/j2re1.4.2_02/javaws exists:

create the file: /usr/java/j2re1.4.2_02/javaws/javaws.cfg
content:
----------------------------------------------------------------------
javaws.cfg.jre.0.path=/usr/java/j2re1.4.2_02/bin/java
javaws.cfg.jre.0.platform=1.4
javaws.cfg.jre.0.product=1.4.0
javaws.cfg.jre.default=0
-----------------------------------------------------------------------

Add this at the end of $HOME/.mime.types

application/x-java-jnlp-file jnlp

And add this at the end of $HOME/.mailcap

application/x-java-jnlp-file;/usr/java/j2re1.4.2_02/javaws/javaws %s

And go to the demo site to check that it works :P


All times are GMT -5. The time now is 01:31 PM.