Solved

Import self-made packages

Posted on 2003-11-09
7
562 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
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
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…

773 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