Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2005

Tip: Looking for answers? Try searching our database.

[eclipse] Errors with import or package

Thread view: 
Franz Mayer - 03 Mar 2005 13:19 GMT
Hi,

I have a odd problem with eclipse 3.0.1 for Win.

When I import some of my package or class, eclipse recommened the
packages & classes in my project. But when I save the project (or
java-file) eclipse shows a lot of errors, because it doesn't find the
package or class. (See code-cutout below)

But my ant-script compiles the source without any message. And the
JSP- and Java-Code runs without problems.

Thanks in advance.
greez Franz

---Code---
package wgims;
[... more imports (nor messages or errors) ...]
import wgims.tools.EnvEntries;    // ERROR: The import
wgims.tools.EnvEntries cannot be resolved
---Code---
Collin VanDyck - 03 Mar 2005 16:14 GMT
> Hi,
>
[quoted text clipped - 10 lines]
> Thanks in advance.
> greez Franz

Franz,

Go into your project properties (make sure it's a Java project), and go
to the Java Build Path category and then click on the Libraries tab.

There, you should add in any jars that are included with your project
(Add Jars...) as well as any jars that might be referenced once your
project is deployed (Add external Jars...)

Also, if you are having general package recommendation errors with
Eclipse, make sure that your source folders are set correctly.

As an example, in my Java project, I have a src/java directory that
contains all of my java source. Under project properties -> Java Build
Path -> Source (tab), I added the folder src/java.  That resolves a lot
of package related errors that Eclipse will report when it thinks that
your project root is the base for your Java source files.

Hope that helps
Collin
Franz Mayer - 04 Mar 2005 09:23 GMT
Hi Collin,

Collin VanDyck schrieb:
> Franz,
>
[quoted text clipped - 4 lines]
> (Add Jars...) as well as any jars that might be referenced once your
> project is deployed (Add external Jars...)
for a while it fixed the problem - but probably it was just an accident ;-)

> Also, if you are having general package recommendation errors with
> Eclipse, make sure that your source folders are set correctly.
I don't get it. What does the source folders mean? (window-pref
java>build path)

I have my java classes and my eclipse-project files in eclipse/workspace/
In "Source folder name" is the value src
In "output folder name" is the value bin

> As an example, in my Java project, I have a src/java directory that
> contains all of my java source. Under project properties -> Java Build
> Path -> Source (tab), I added the folder src/java.  That resolves a lot
> of package related errors that Eclipse will report when it thinks that
> your project root is the base for your Java source files.
I added under project-properties java build path>Source edit included.
There added the folder with all my source (wgims). But it refreshed only
and after a short while the errors occured again.

One (maybe) interesting error I forgot to note:

In some classes eclipse say (the error has no location line):
A class file was not written. The project may be inconsistent, if so try
refreshing this project and building it

Thanks in advance.
greez Franz


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.