Linux - Newbie This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
12-16-2007, 01:15 PM
|
#1
|
LQ Newbie
Registered: Nov 2007
Posts: 9
Rep:
|
Newbie java classpath problem
I have just installed slackware 12 onto my machine. I have noticed that the java runtime and jdk is currently present version 1.6.0_01-bo6. I have tried to run javac but getting the bad command error ie noc classpath set. However i added this to the profile in etc:-
PATH=$PATH:/usr/lib/jre1.6.0_01-bo6
JAVA_HOME=/usr/lib/jre1.6.0_01-b06
export $PATH $JAVA_HOME
Now when i log out and log back in i get the foillowing error message
-bash export:/PATH=$PATH:/usr/lib/jre1.6.0_01-bo6 not a valid identifier
i would appreciate any help whatsoever.
|
|
|
12-16-2007, 01:30 PM
|
#2
|
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298
Rep:
|
Try
Code:
export PATH=$PATH:/usr/lib/jre1.6.0_01-bo6/bin
export JAVA_HOME=/usr/lib/jre1.6.0_01-b06
|
|
|
12-17-2007, 03:19 AM
|
#3
|
LQ Newbie
Registered: Nov 2007
Posts: 9
Original Poster
Rep:
|
Newbie java classpath problem
thank you for your response, however, I have tried that and it does not work .
|
|
|
12-17-2007, 07:02 AM
|
#4
|
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298
Rep:
|
What is the output of
Code:
ls /usr/lib/jre1.6.0_01-bo6
and
|
|
|
12-17-2007, 07:50 AM
|
#5
|
LQ Newbie
Registered: Nov 2007
Posts: 9
Original Poster
Rep:
|
setting java classpath
Ok the output from the line ls /usr/lib/jre1.6.0_01-bo6 is a list of the directory which is
welcome.html
copyright
readme
license
javaws/
bin/
plugin/
koala.jar
man/
qtjava.jar
and the output from echo $Path is nothing
Does that look correct
|
|
|
12-17-2007, 08:29 AM
|
#6
|
Member
Registered: Aug 2003
Distribution: Debian, Ubuntu
Posts: 188
Rep:
|
Not really. ;-)
Did you type
or
(cave: case sensitivity)
|
|
|
12-17-2007, 08:40 AM
|
#7
|
LQ Newbie
Registered: Nov 2007
Posts: 9
Original Poster
Rep:
|
Ah sorry yes you are correct i typed echo $Path rather than echo $PATH, i typed echo $PATH and this is the output
/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:bin:/usr/games:/usr/lib/java/bin:
/usr/lib/java/jre/bin:/usr/lib/qt/bin:/usr/share/textmf/bin:/usr/lib/jre1.6.0_01
So from what i can see my java and jre are there and recognised but why wont the javac command work?
|
|
|
12-17-2007, 09:09 AM
|
#8
|
Member
Registered: Aug 2003
Distribution: Debian, Ubuntu
Posts: 188
Rep:
|
This path looks much better.
If I see correctly, you have installed a java runtime environment (jre), what includes everything tu run java applications.
You should be able to run something like
Compilers (javac), docs and tools come with the java development kits (jdk's). If not shiped with your distro, you can download them from http://java.sun.com/.
The jdk comes as executable file that installs the jdk (non graphical, at command line) once launched. After installing whereever you want, you have to adjust your $JAVA_HOME and $PATH again.
I should have seen this before, sorry.
Hope this one helps,
Clemente
|
|
|
12-17-2007, 09:19 AM
|
#9
|
Member
Registered: Aug 2003
Distribution: Debian, Ubuntu
Posts: 188
Rep:
|
UPDATE: You propably will not be able to run java -version as stated before...
A closer look to your echo $PATH output shows the part:
Quote:
[...]/usr/lib/java/bin:[...]/usr/lib/jre1.6.0_01
|
In a previous posting, I saw a path like
Quote:
/usr/lib/jre1.6.0_01-bo6/bin
|
If running java, bash looks all directories in $PATH from first one to the last one. The first occurence of en executable "java" program will be launched.
With your current $PATH, you will start something in /usr/lib/java/bin, if present, or in /usr/lib/jre1.6.0_01. But nothing in /usr/lib/jre1.6.0_01-bo6/bin, what I suppose you to want.
Sound weird. ;-)
You can clean your classpath, or (the dirty way), you can export the $PATH with
Code:
export PATH=/path/ro/your/jdk/bin:$PATH
instead of
Code:
export PATH=$PATH:/path/ro/your/jdk/bin
This way, the first directory, bash looks for your java, is /path/to/your/jdk/bin. All remaining directories will be ignored.
Less work, but little dirty.
|
|
|
12-17-2007, 10:26 AM
|
#10
|
LQ Newbie
Registered: Nov 2007
Posts: 9
Original Poster
Rep:
|
Hi thanks for that, however, when i type java -version i get jre1.6.0_01-bo6
What i want to know is how do i get my compiler to compile, will someone tell me what i have to do. If i have to type a file in profile or profile.d or what i dont care i just want to get this working.
|
|
|
12-17-2007, 11:04 AM
|
#11
|
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298
Rep:
|
Its already been mentioned that javac is not available if you only have the jre installed. You need to install the jdk if you want to do java development. Cheers.
|
|
|
12-19-2007, 08:00 AM
|
#12
|
LQ Newbie
Registered: Nov 2007
Posts: 9
Original Poster
Rep:
|
Hi to all of the people who have posted back to my request for help, well I have loaded the jdk and I now have a running java compiler, thank you.
|
|
|
All times are GMT -5. The time now is 03:07 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|