Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-21-2009, 01:08 AM   #1
LQ Newbie
Registered: Sep 2009
Posts: 8

Rep: Reputation: 0
Unhappy i set CLASSPATH but still can't comile my java code

I am learning j2se n i have fedora 9 installed. While learning using packages I had to set set CLASSPATH. I wrote:
because I wanted to import a class whose corresponding bytecode was saved in the mentioned /home/.../bytecode folder.
I tried echo $CLASSPATH and it showed the expected output.
but when i tried to compile my new class using
javac -d /home/.../bytecode
it shows the errors:
package ABC does not exist
cannot find symbol

[ABC is the package that holds the previously compiled class that i want to import]

Please help..
thanking you,
Old 09-21-2009, 02:36 AM   #2
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

This link might help:

Basically, do this:
1. If you've got a package "graphics", with a class "Rectangle"...
//in the file 
package graphics;
public class Rectangle {
   . . . 
2. ... then put your source file "" in a subdirectory called "graphics":
3. ... and compile and run your program directory ABOVE "graphics":
javac graphics/
java graphics/Rectangle
'Hope that helps .. PSM

You might find this link helpful, too:

Last edited by paulsm4; 09-21-2009 at 02:38 AM.


code, compiling, java, trouble

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to set java classpath on Redhat 9? antony_csf Programming 9 11-26-2004 06:48 AM
How to set CLASSPATH of java in Linux? vanhelsing Programming 1 08-23-2004 07:16 AM
I've set the CLASSPATH, but I still get a noClassDefFoundError. (Java) Travis86 Programming 6 02-05-2004 10:09 AM
set classpath in linux(slackware9) for java Manjula.S Linux - Software 1 10-16-2003 03:10 AM
How to set classpath for java jolly Linux - Software 3 04-22-2003 11:02 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:34 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration