jQuery in Action, 3rd edition
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "package problems..." Watch "package problems..." New topic

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:


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: 980

Ur package A is not in the classpath...

Set it and u wud be on ur way..

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!


Java API Documentation
The Java Tutorial
I agree. Here's the link: http://aspose.com/file-tools
subject: package problems...
It's not a secret anymore!