Accessing User Packages

Hi Experts,

I thought this would be a straight forward question but looking @ PAQ it is not :-s. I have created a suite a of classes that form a Package SConnnect. I need various other apps/pjojects/clasess out side the Sconnect to see/use these classes. How do I import them in to a diffrent app.

I using Jbuilder if that makes any diffrence.

Geraint
LVL 1
GTwoDAsked:
Who is Participating?
 
limaidealCommented:
In project properties, go to "Required Libs"
Click Add, then New
Enter a name for your lib, add all jars/classes required
Hit OK to close.

Hit OK to select the newly created lib
Ok again to close project properties.

In your code, need to import your package and compile again. It should work
0
 
CEHJCommented:
Surely just add the jar to the project ..?
0
 
CEHJCommented:
(and import them with import statements of course)
0
 
aozarovCommented:
>> Package SConnnect
It is conventional to name packages using only lowercase characters (e.g. sconnect)

>>  need various other apps/pjojects/clasess out side the Sconnect to see/use these classes
As long as your classes inside SConnect are defined as public other classes which are not inside that package should be able to use them.
If you have a class which is not "public" it will not be accessible outside its package.
You do need to import those classes (or do import SConnnect.*) as CEHJ suggested.
0
 
GTwoDAuthor Commented:
Sorry for the long delay, it is a lot simpler than I thought I was getting confused with having to put classes in the lib directory to import them.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.