Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Package Searching

 
Denise Advincula
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I hope you can help me. I can't figure out how to compile this program successfully using javac.

I have two packages: p1 contains A.java, p2 contains B.java. They're in this folder: "packages".


This is how it's structured:

packages
- p1 - A.java
- p2 - B.java

B.java needs to access A.java so it has an import p1.* statement. I keep on getting this error when I try to compile B.java:



I know something's wrong with my invocation but can anyone please correct me? I tried a lot of stuffs already but nothing seems to be working. Thank you in advance!
[ September 08, 2008: Message edited by: Denise Saulon ]
 
Ankit Garg
Sheriff
Posts: 9580
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
compile B.java as

javac -d classes -cp classes p2/B.java

as p1/A.class is in classes folder...
 
Denise Advincula
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It worked!! Finally I get the idea now. Thank you for your support!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic