LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Howto install/use java(jre)? (https://www.linuxquestions.org/questions/linux-newbie-8/howto-install-use-java-jre-312503/)

eras 04-12-2005 02:35 PM

Howto install/use java(jre)?
 
Hi all!

I have been using Linux for a few days and I just tried to install Java Runtime Enviroment. Well, I downloaded the self-extracting .bin file and installed it to /usr/java, but I have no idea how to use it...

What should I do if I wanted to run java programs like "java <program name>"? Is there a way to install programs so that I can use them like that? Should I install them to some special place or what?

Thanks for your time, I hope someone has time to aswer this =)

fatrandy13 04-12-2005 03:29 PM

what type of file are you trying to open using JRE ..... a .jar file?

resego 04-12-2005 04:42 PM

eras....are you asking how you can run HelloWorld and staff like that..cuz to be honest your question is not clear

Komakino 04-12-2005 04:52 PM

Quote:

Originally posted by resego
eras....are you asking how you can run HelloWorld and staff like that..cuz to be honest your question is not clear
Yes it is.

You'll need to add the java bin directory to your path. The best way to do this so that it's there for every user is to edit /etc/profile as root and find the line that says PATH=........etc........

At the end of the line (but inside any "" marks) add:
Code:

:/usr/java/bin
(if that's where you put java and that's where its bin directory is...)

For that to take effect you'll either need to reboot or:
Code:

source /etc/profile
I actually have the first line of my .bashrc file (in each user's home dir) set to the above source line because sometimes bash run from xterm (i.e. as a non login shell) does not include the things in /etc/profile.

resego 04-12-2005 05:00 PM

does your /usr/java file have a version of java in it
...just type this at the terminal:
$ which java
and post the output here..

Komakino 04-12-2005 05:05 PM

Quote:

Originally posted by resego
does your /usr/java file have a version of java in it
...just type this at the terminal:
$ which java
and post the output here..

/usr/java is a directory...


All times are GMT -5. The time now is 04:55 AM.