where to install java ?
To which directory i should install jdk 1.4?
i am both the root and the user . which directory i should install java ? suppose, i install jdk1.4 in root. directory.. ..now if i log in as a user "user " will i able to access java ? similarly, if i install jdk1.4 in "user " directory , will i able to access java when i log in as root ? i am confused where to install java whether in root directory or in user directory . any help ? i also, want to install tomcat too. where do i install that also ? |
Install it as root either to /usr/local/ or to /opt/
You will be able to use it as both root and user, no problem. |
You can probably get it for your distrobution, which you should supply. Then someone can probably point you to a pre-built package of java for your.
|
i have installed java . but How do i set the PATH ?
my shell is bash shell. please tell in steps . i am a newbie. |
my java has been installed in directory
/usr/java/jdk1.5.0_04 i am getting difficulty to set the PATH . how to set the PATH ? i want to compile HelloWorld.java. please help me. Regrds Volcano |
>Install it as root either to /usr/local/ or to /opt/
ohh...i have installed in the root ! :cry: that means other user can not access java ? |
Quote:
Everything will be ok. You can set your PATH to the java binaries and all users will be able to use it. Become root by using su. Then make a link with a nice name to your new installation of java, for example like this: Code:
ln -s /usr/java/jdk1.5.0_04 /usr/local/jdk Code:
export PATH=$PATH:/usr/local/jdk/bin R. |
hi,
my my java has been installed in directory /usr/java/jdk1.5.0_04. i have some question on your comment. Question1 : Quote:
ln -s /usr/java/jdk1.5.0_04 /usr/local/jdk but inside /usr/local/ there is no jdk folder ! .....do you mean i should create jdk folder there first before executing your code ? i dont like this name jdk , i want to create a folder java instead of jdk . and want to run ln -s /usr/java/jdk1.5.0_04 /usr/local/java is there any problem ? will i face any problem later on ? Question 2: Quote:
but how do open that file ? [root@machineroot]#vi /etc/profile ===>this does not work. i am also surprised that the file has no extenstion ! is it profile.txt ? Please help, i am a very much newbie.....so please bear with this silly questions. All i need is to install java. Regards |
1)
Code:
ln -s /usr/java/jdk1.5.0_04 /usr/local/java What you are doing is creating a Symbolic Link (Shortcut) with a nice name to /usr/java/jdk1.5.0_04. This step is optional, you only need to do it if you want. You are NOT creating a new folder, just a shortcut to an existing one. 2) Code:
[root@machineroot]#vi /etc/profile It does not have an extension, many files in linux don't have extensions. I hope this helps, and post back with any further problems --Ian |
Sir, hurrah...it started working !
sir ,if I copy the whole jdk1_5_04 from /usr/java directory and pasted into /usr/local directory will that work ? please tell me. thank you |
Yes, but you would need to change your PATH, as you already have done.
Why bother though? There is no real benefit to be gained from this. I hope this helps --Ian |
Sir,
if i did not do symbolic link ln -s /usr/java/jdk1.5.0_04 /usr/local/jdk but only.... typed export PATH=$PATH:/usr/java/jdk1.5.0_04/bin does not everybody could access java ? i guess all user could access java because i am setting the PATH here. there is no need to do symbolic link. is not it ? but in the first response, somebody told your java could be accessed if you install in/usr/local directory !......its meaningless.what the speciality this folder(/usr/local)posses so that all application software should be available here for accessible to everybody ? |
Yes, there is no need for the symbolic link, you can just add the jdk1.5... directory to your path.
Traditionally, programs that you install yourself are installed to /usr/local. There is nothing special about this, except the permissions will allow all users to read or execute files stored there. If you install to a users home, only that user can access the file. You can also install programs to /usr/lib, or /opt, but /usr/local is normally used for programs you install manually, while /usr/lib is normally used for programs installed by a package manager (rpm, apt-get, etc). See The File Heirachy Standard for more if you are interested. I hope this helps --Ian |
Quote:
you know i typed [root@machine root]#rpm -ivh jdk_1_5.....rpm and my file jdk_1_5... goes into /usr/java/jdk_1_5...... is not it starnge ? IT SHOULD HAVE BEEN GONE TO /usr/local by default as you told . but it did not ! Of couurse, i logged as root and then i downloaded the java and hen installed . do you suggest i should logged in as a user and then i should use su to be root for installation . if i did that then did my file goes into /usr/local ? |
No, no, no.
When you install a program using rpm, it will install to other locations, such as /usr/lib (Or in this case /usr/java). Programs you install yourself (using a bin file, such as firefox) are normally installed to /usr/local. It really doesn't matter though, it is mainly just established practice. --Ian |
All times are GMT -5. The time now is 04:06 PM. |