Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Accessing User Packages

Posted on 2005-04-27
5
Medium Priority
?
234 Views
Last Modified: 2010-03-31
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
0
Comment
Question by:GTwoD
5 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 13875768
Surely just add the jar to the project ..?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 13875773
(and import them with import statements of course)
0
 
LVL 2

Accepted Solution

by:
limaideal earned 500 total points
ID: 13875988
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
 
LVL 15

Expert Comment

by:aozarov
ID: 13876506
>> 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
 
LVL 1

Author Comment

by:GTwoD
ID: 13953123
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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month13 days, 15 hours left to enroll

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question