Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse - how to import classes? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse - how to import classes?" Watch "Eclipse - how to import classes?" New topic

Eclipse - how to import classes?

Roy Mallard
Ranch Hand

Joined: Jul 14, 2005
Posts: 53
I'm trying to get this
OSXadapter to work so my swing application can say "are you sure" before closing in OS X, like it does already in Windows.
I tried to import the classes with "import filesystem", and I can see the .class files in the "Navigator" view, but when I try to compile I get the error "package does not exist".
Any help will be appreciated.

SCJP 1.4<br />SCJD
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33130

Welcome to JavaRanch!

I'm assuming you imported those classes into a new project. Did you update the build path of your Swing project to reference this new project?

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17421

1. Right-click on your project's icon
2. From the pop-up menu, select "Properties" (ALT+Enter)
3. In the properties dialog, select "Java Build Path"
4. Click on the "Libraries" tab
5. If the jar in question is part of your project directory tree, select "Add JARs...". If it is not, select "Add External JARs"

You can probably guess what comes next. Once you've added the JAR, it will show up in the list of jars and class folders. Select OK, and expect to be notified that the project must rebuild itself (in order to take advantage of your new definition).

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Eclipse - how to import classes?
It's not a secret anymore!