• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Importing own Packages

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a Million Merrill.
 
There are 29 Knuts in one Sickle, and 17 Sickles make up a Galleon. 42 tiny ads in a knut:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic