File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Imorting packages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Imorting packages" Watch "Imorting packages" New topic
Author

Imorting packages

Aruna Balasuriya
Ranch Hand

Joined: Nov 14, 2009
Posts: 44
To import a package that create by me , should it be in the current directory where I run the program
Hiruka Sandev
Greenhorn

Joined: Nov 22, 2009
Posts: 11
You need not have it in the current directory if you have the path to your package (i.e the package to import) in your classpath.
Aruna Balasuriya
Ranch Hand

Joined: Nov 14, 2009
Posts: 44
Hiruka Sandev wrote:You need not have it in the current directory if you have the path to your package (i.e the package to import) in your classpath.


Please Explain how do I do that
Hiruka Sandev
Greenhorn

Joined: Nov 22, 2009
Posts: 11
If the package you created is at C:\Java\MyPackage and the class you are trying to compile(HelloWorld.java) is in the current directory, you could try

javac -classpath c:\Java HelloWorld.java
java -classpath .;c:\Java HelloWorld
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Imorting packages
 
Similar Threads
WA #1.....word association
ServletContext
SecurityException: Prohibited package name
Creating a Web Service in Eclipse: NoClassDefFoundError
jrun 4 + IIS + jdk 1.4 --> not able to find package