aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Unable to Understand - import and classpath scjp 6 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "Unable to Understand - import and classpath scjp 6" Watch "Unable to Understand - import and classpath scjp 6" New topic
Author

Unable to Understand - import and classpath scjp 6

Tahir Akram
Ranch Hand

Joined: Jul 03, 2007
Posts: 37
From SCJP by Kathy sierra chapter 10 page 804.

Remember when using a classpath, the last directory in the path must be the
super-directory of the root directory for the package.


I am unable to understand this statement.

I am also unable to use classpath with import statements.

I am using the following classpath to compile the Outer.java



caller class



and called class is




and the problem I am getting...



Tahir Akram
Zulqarnain Hafeez
Greenhorn

Joined: Aug 13, 2010
Posts: 3
Hello Tahir,

Using package and import in your java file.
Execute this

javac -classpath . Outer.java


in your example com.utils.Inner is fully qualified name of class
thats why com\utils package does not exist error occurs.


Please consider this example






javac -cp . Outside.java



Hope this will clear.

Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

and Welcome to JavaRanch Zulqarnain Hafeez
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to Understand - import and classpath scjp 6
 
Similar Threads
Finding class files using the -cp command
SCJP 5 Study Guide: Self Test Q. 12 - Page 788
importing multiple classes from a package
File not getting imported
classpath problem