Solved

Import self-made packages

Posted on 2003-11-09
7
559 Views
Last Modified: 2006-11-17
Im using JBuilder 9 and i'm trying to import some of my packages into my current .java files, but it says it cant find them even though when i type import, the menu appears and i can select the package. It is just some basic code, but it just ont grab those packages. Please tell me what im doing wrong.
0
Comment
Question by:JTWolfman
  • 3
  • 2
  • 2
7 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 9710457
Make sure you have the import xxx.yyy.zzz statement at the top of your code
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9710472
It looks more like the classpath isn't including the directory where your .class files are (for your existing packages).  If they're in a jar, you'll need to include the jar file itself, not just the directory that contains it.
0
 

Author Comment

by:JTWolfman
ID: 9710493
Ok, i got a package Files and a package Browsers, in a file inside of Browsers, i try and use a contructor in the Files package under the class setName.
I try and import using import Files.* to get all of them since i will use them all eventually, but it says "Package Files does not exist" even though it is there.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 15

Accepted Solution

by:
jimmack earned 70 total points
ID: 9710504
Do you mean that you have a class defined as:

package Files;

import...

public class setName
{
    .
    .
}

From the naming convention you are using, it looks like you might actually mean:

package ???;

public class Files
{
    public void setName(...)
    {
        .
    }
}

If this is the case, you need to import ???.Files.

0
 

Author Comment

by:JTWolfman
ID: 9710534
Oops, what a big *DOH*. thanks man, you earn points do to a braing fart.
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9710570
;-)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9710658
>>If this is the case, you need to import ???.Files.

Isn't this precisely what i said in the first place?
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now