• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

package problems...

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

Ur package A is not in the classpath...

Set it and u wud be on ur way..

Bye
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you need help with setting your CLASSPATH, see this page from our friendly FAQ!

Layne
 
30 seconds to difuse a loaf of bread ... here, use this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic