File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes please help import pakage how Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "please help import pakage how" Watch "please help import pakage how" New topic
Author

please help import pakage how

Sahil Ji
Greenhorn

Joined: Apr 04, 2012
Posts: 6
//first class in import folder


package importpackage;

public class HelloWorld {
public void show(){
System.out.println("This is the function of the class HelloWorld!!");
}
}


//second class immediately above importpackage folder


import importpackage.*;

class CallPackage{
public static void main(String[] args){
HelloWorld h2=new HelloWorld();
h2.show();
}
}

c:--->nisha---->CallPackage.java
|
|--->importpackage ---->HelloWorls.java


C:\nisha\importpackage>javac *.java

C:\nisha\importpackage>cd..

C:\nisha>javac CallPackage.java *****ERROR importpackage does not exist************



Please solve problem


Thanks in advance



Helen Ma
Ranch Hand

Joined: Nov 01, 2011
Posts: 451
Try this:
C:\nisha>javac importpackage\CallPackage.java

In order to compile CallPackage under c:\nisha path, you need to specify where CallPackage.java is.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: please help import pakage how