File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes package problems... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "package problems..." Watch "package problems..." New topic
Author

package problems...

Prashanth Lingala
Ranch Hand

Joined: Nov 13, 2004
Posts: 66
Hi Friends...
I got a peculiar problem...

i have a directory c:\first in which i have placed A.java
i have a directory c:\second in which i have placed B.java

Here's the source:



and


A.java compiles fine
So far so good...
when i compile from B.java c:\second on the command prompt

i get the following error

C:\second>javac B.java
B.java:3: package first does not exist
import first.*;
^
B.java:5: cannot resolve symbol
symbol : class A
location: class second.B
class B extends A {}
^
2 errors


I dont know what mistake i am making...???
kindly explain me...


Have A Nice Day !!!
A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 979
hi,

Ur package A is not in the classpath...

Set it and u wud be on ur way..

Bye
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
If you need help with setting your CLASSPATH, see this page from our friendly FAQ!

Layne


Java API Documentation
The Java Tutorial
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: package problems...
 
Similar Threads
using package getting compiler error
Access modifiers
Not able to COMPILE!!!
Help on Packages!!
can't compile a servlet