• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Importing own Packages

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using NetBeans IDE. I can import all Java API packages by using the command import java.util.*;, etc.
But if I create a Project which has a package called "thinking", and try to import "thinking" from another Project. Compiler gives a message saying "thinking" does not exist.

The directory path for "thinking" is C:\JavaPrograms\Thinking\src\thinking.
And I have added it to the Classpath Variable which now looks like:
.;C:\Program Files\Java\jre1.5.0_07\lib\ext\QTJava.zip;C:\JavaPrograms\Thinking\src

Please advise.

Thanks
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to tell NetBeans where to look for classes in a specific project. To do this:

1-in the Projects panel, find the project and right-click it.

2-Select properties from the context menu.

3-Select Libraries in the categories panel

4-Click the Add Project button

5-Select the project that contains your "thinking" package, and press the Add Project button.
 
Jack Mullaly
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a Million Merrill.
 
Switching from electric heat to a rocket mass heater reduces your carbon footprint as much as parking 7 cars. Tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!