• Post Reply Bookmark Topic Watch Topic
  • New Topic

Package / classpath problem  RSS feed

 
Bora Sabrioglu
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I have following classes in the corresponding folders:



in C:\Users\me\Desktop\myJavaFolder

and

in C:\Users\me\Desktop\myJavaFolder\subFolder.

On the command line I made "C:\Users\me\Desktop" my current directory. Then on the command line I typed:



It compiled.

Then I tried to compile B as well and typed:



But it can't find A:

.\myJavaFolder\subFolder\B.java:4: error: cannot find symbol
class B extends A{
^
symbol: class A
.\myJavaFolder\subFolder\B.java:7: error: cannot find symbol
System.out.println(new B().i);
^
symbol: variable i
location: class B
2 errors


What am I doing wrong?
 
Bora Sabrioglu
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
k, found the error... the classpath has to be the current directory (.) in order for A to be found...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!