Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Import self-made packages

Posted on 2003-11-09
7
Medium Priority
?
577 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 15

Accepted Solution

by:
jimmack earned 280 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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 about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

718 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