SlackwareThis Forum is for the discussion of Slackware Linux.
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.
heres the deal i want to upgrade my current slack box's java from the default package to the current 5.01. now i removed the old package and installed the new java to usr/local/java now my main problem is i cannot get java from the command line. normally i would just create a symbolic link in /usr/local/bin but im pretty sure this doesnt work for java any help would be appreciated. oh and i dont want to use the package if i can avoid it i really dont like having to use packages becasue i tend to lose track of where everything is i would much rather have it be installed where i want it to be. Thanks.
Distribution: slamd64 2.6.12 Slackware 2.4.32 Windows XP x64 pro
Posts: 383
Rep:
try ./usr/local/java/java
to get the java to work in the browsers you have to sym link the plugin to the plugin dir of the browser. hope that makes since. I don't understand what you mean by can't get java on command line. /usr/local/java has to be in your path so you can just type java.
what i mean by can't get it form command line is i can no longer do somehting like java -version and see the version. and applications that look for it in my path can't find it and i have to make some shell script or edit an existing one to make them work correctly limewire for instance. so basically i need to know how to get it to work in my path oh and ./usr/local/java/java did not work but i hope you undersatand my problem now.
You need to locate the java bin file. If you installed it to /usr/local/java, then look in /usr/local/java/bin/ or just use 'locate java' after a updatedb. Once located, you can either add the bin directory to your path, to your /etc/profile or just symlink it.
i tried ./usr/local/java/jdk1.5.0_01/bin/java
and i get no such file or directory but the file does exist right there
i tried it as both root and as a user
Obviously you need to remove the leading period.
Just use /usr/local/java/jdk1.5.0_01/bin/java.
The installation package for the JDK does not only extract the files, but also sets up some user settings like the path variable, JAVA_HOME and a nomber of other settings.
I am not sure wheter the Java package or the Mozilla package set up the link for the Java plugins, so that might need checking.
Just extracting the JDK does not do the job. Although it will be functional, it needs to be 'registered' in the OS.
Heres what I did to get the java from Sun working proper on my Slack system.
1) I installed it to /opt/jdk1.5.0
2) I then made a symlink to it as follows
#ln -s /opt/jdk1.5.0 /opt/java
3) I then made the little script below and placed it in /etc/profile.d as java.sh
#!/bin/bash
#my java path script
JAVA_HOME=/opt/java
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
Modify it so it suites the paths on your system. All users will have access to java. If you update java, just remember to create a symlink to the newer version.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.