PDA

View Full Version : installing JAVA for a newbie.



xaviers2002
07-07-2004, 11:01 PM
I am trying to install JAVA into my HD but I am having problem. I have tryed to follow the instructions at the java web site but without any results.

Thank You.

mzilikazi
07-08-2004, 12:38 AM
Go here:
https://sdlcweb1a.sun.com/ECom/EComActionServlet;jsessionid=sdlcweb1a.sun.com-78d1%3A40ec87b0%3A1e43ef554bfba8eb

Scroll down
Get this:
self-extracting file (j2re-1_4_2_05-linux-i586.bin, 13.72 MB)

Save it to your home directory.
chmod +x j2re-1_4_2_05-linux-i586.bin
./j2re-1_4_2_05-linux-i586.bin

Hit <enter> to get to the bottom of the agreement.
Type 'yes'

voila!


Here are the official directions from SUN:
http://java.sun.com/j2se/1.4.2/install-linux.html

xaviers2002
07-08-2004, 10:13 PM
I don't know why, but the web page You gave me was sending me somewhere else, so I found "j2sdk-1_4_2_05-linux-i586.bin". Downloaded and installed with Your tips it seems to work fine... no errors on the installation! What is the difference between the "j2sdk" and the "j2rd"?
Thanks.

user unknown
07-08-2004, 11:20 PM
I never heared from j2rd, only j(2)re.

The second is the java-runtime-environment, to run java-programs.
The first is the java-software-development-kit, to develop java-programs.

If you have the sdk, a jre is included already.
Adding JAVA_HOME to your user-environments in /etc/profile is recommendet if you develop java-programs, i.e:

export JAVA_HOME=/opt/j2sdk

xaviers2002
07-09-2004, 12:20 AM
i am sorry "RE" not "RD"! I will try that as soon as I can. Thanks :wink:

xaviers2002
07-09-2004, 12:24 AM
"export JAVA_HOME=/opt/j2sdk"

Do I have to run this from root or command?
Nothing has happened form root.
Thanks

mzilikazi
07-09-2004, 12:54 AM
I don't know why, but the web page You gave me was sending me somewhere else, so I found "j2sdk-1_4_2_05-linux-i586.bin". Downloaded and installed with Your tips it seems to work fine... no errors on the installation! What is the difference between the "j2sdk" and the "j2rd"?
Thanks.

gah silly SUN makes it hard to link to their downloads. Commercialism at its finest I tell you!

you DO need j2re!

Try this link:
http://java.sun.com/j2se/1.4.2/download.html

Scroll down to where you see this:

Download J2SE JRE

When you click that link you will be taken to a licensing agreement. Hit "accept" and "continue".

Download this:
self-extracting file (j2re-1_4_2_05-linux-i586.bin, 13.72 MB)

xaviers2002
07-09-2004, 03:58 AM
ok done!!! thanks
Is there a common way of installing programs on debian or every program is different?
Thank You again.
Also what is the difference between the begginer installation and the debian like...?

mzilikazi
07-09-2004, 05:33 AM
ok done!!! thanks
Is there a common way of installing programs on debian or every program is different?

Java is a proprietary software from SUN. It is not OSS (Open Source Software) like Debian GNU Linux. Debian uses dpkg to install packages. The easiest way to use dpkg is apt-get which is a frontend for dpkg. *most* packages are already in Debian and only require a simple command:

apt-get install cdcd

for example. If an application does not exist in the Debian archives you may search here: http://www.apt-get.org/ and perhaps someone has made unofficial packages for Debian. Otherwise you would use source code to compile and install software.


Also what is the difference between the begginer installation and the debian like...?

As I understand it the beginner is most like booting from cd. I think there are several forum postings on that topic already. "Debian like" would be a not so standard Debian installation (but still Debian none the less). Debian is notoriously difficult to install for a beginner. Even the current installer is quite unattractive and yet I have to say that IMHO installing Debian w/ either boot flopies or a small cd image is the best. You simply install the base system and build it from there. As you use Debian more you will come to understand its ways. :)

xaviers2002
07-09-2004, 08:53 PM
If I got it right the "normal" way to install a progrtam on Debian is: open a root shell, type "dpkg apt-get install" followed by the name of the of the program that was downloaded. Correct?

Thanks

gradnite
07-09-2004, 08:58 PM
If I got it right the "normal" way to install a progrtam on Debian is: open a root shell, type "dpkg apt-get install" followed by the name of the of the program that was downloaded. Correct?

Thanks

Yes, but Java cannot be installed this way?

Also, how do you install the executable java installation file? I downloaded it, but I'm such an idiot that I don't know how to install it. Any help? Thanks.

xaviers2002
07-09-2004, 10:32 PM
It is not that complicate....
Open a root shell; than write "chmod +x" "space" "name of the file" "enter".
ES. "chmod +x j2re-1_4_2_05-linux-i586.bin". It should look like this!!!
Than: ./j2re-1_4_2_05-linux-i586.bin.
Voila'!!! Click enter to go at the end of the page: type yes. Wait to see "DONE" close the shell.

user unknown
07-09-2004, 10:58 PM
"export JAVA_HOME=/opt/j2sdk"

Do I have to run this from root or command?
Nothing has happened form root.
Thanks

Well - of course you have to set the java home to the dir, where YOU installed it - perhaps it's /opt/j2sdk, perhaps it's not.

run from root? run AS root?
run from COMMAND? (from what else? from PIZZA?)
JAVA_HOME is a variable, which is frequently used by programs, which use java, like a IDE (eclipse) or ant - a build-tool for java like 'make' for c++.

It should be set for every TERMINAL/ ENVIRONMENT where a program is run, which might be interested in the JAVA_HOME.

If you're root and user xaviers on your system, and the only user, and might use java as root, you would set it in /etc/profile.
If you're only using java as xavier, you would put it to /home/xaviers/.bashrc or ~/.bash_login or ~/.profile.

If you only use java for 2 or 3 times, you wouldn't set it at all, or issue the command in the shell directly.

If you're running java for some years and trying differnt versions parallel, you would set it to /opt/java and generate a symbolic link

ln -s /opt/j2sdk-1.4.3 /opt/java
# and for testing remove the link, and create a new one:
ln -s /opt/j2sdk-1.5.0-3 /opt/java
and the JAVA_HOME would automatically point to the appropriate directory via the symbolic link.[/code]

xaviers2002
07-09-2004, 11:17 PM
"for mzilikazi"

What is the difference between writing "chmod +x" or not?
I have installed java with both method and everything was fine...
Thanks

user unknown
07-09-2004, 11:40 PM
man chmod.

If you CHange MODe of a file +eXecutable (alternatives: Read Write), you make it executable.
Then you can start xy.bin with './xy.bin'.
Else you have to run it as script: 'sh xy.bin'.
If the file is already executable, chmod +x has no effect.

Of course you cannot make any file executable this way.
You only modify an attribute of the file, indicating that it is excecutable.

If you call 'chmod +x flower.bmp' or 'rollOverBeethoven.wav' - the files aren't executable at all.
You will get a message 'no interpreter' or 'unknown file format' if you try to execute them.

gradnite
07-10-2004, 12:39 AM
I am further confused. :D

So, where do I put the java executable file when I download it? Then what do I do to install it?

Thanks.

P.S. Do I use this similar process for installing Real Player because Real Player is not available via apt, is it?

mzilikazi
07-10-2004, 03:29 PM
Use the instructions I've already posted.

Go here:

http://java.sun.com/j2se/1.4.2/download.html

Scroll down
Get this:
self-extracting file (j2re-1_4_2_05-linux-i586.bin, 13.72 MB)

Save it to your home directory.
chmod +x j2re-1_4_2_05-linux-i586.bin
./j2re-1_4_2_05-linux-i586.bin

Hit <enter> to get to the bottom of the agreement.
Type 'yes'

gradnite
07-11-2004, 05:53 AM
Use the instructions I've already posted.

Go here:

http://java.sun.com/j2se/1.4.2/download.html

Scroll down
Get this:
self-extracting file (j2re-1_4_2_05-linux-i586.bin, 13.72 MB)

Save it to your home directory.
chmod +x j2re-1_4_2_05-linux-i586.bin
./j2re-1_4_2_05-linux-i586.bin

Hit <enter> to get to the bottom of the agreement.
Type 'yes'

Thank you. I got it to work. :D Is there anyway I can make Mozilla Firefox work with the java too? Right now java only works when I use konquerer.