Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Then make a link with a nice name to your new installation of java, for example like this:
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:
Then open file /etc/profile as root in a text editor and add this line to the end of the file:
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.
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088
Rep:
1)
Code:
ln -s /usr/java/jdk1.5.0_04 /usr/local/java
This command will be fine. Just make sure that you use /usr/local/java not /usr/local/jdk.
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
This does not work. It should do, what error message do you get. Remember that Linux is Case Sensitive - /ETC/PROFILE is not the same as /etc/profile. The correct one is lower case.
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
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 ?
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088
Rep:
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).
Traditionally, programs that you install yourself are installed to /usr/local
thats a very surprising thing to me .
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 ?
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.