Skip to main content



      Home
Home » Newcomers » Newcomers » How make Eclipse work with packages in parallel directory sturcture
How make Eclipse work with packages in parallel directory sturcture [message #269892] Wed, 01 April 2009 21:20 Go to next message
Eclipse UserFriend
Hi, I have the following directory structure w/ JUNIT (which is not really
relevant though)

src
com
xyz
SomeClass.java
test
com
xyz
SomeClassTest.java


Unfortunately, within Eclipse, SomeClassTest cannot test SomeClass,
because it cannot "see" SomeClass even though they are supposed to be in
the same package com.xyz. Eclipse would simply complain that SomeClass
cannot be resolved, with an "X" icon at the offending line that references
SomeClass within SomeClassTest.

Can I resolve this issue in Eclipse, or do I have to do this manually
(e.g. via ANT) by copying these files into the same directory before
compiling them together (which means, I wouldn't be able to use Eclipse
anymore). Thanks....
Re: How make Eclipse work with packages in parallel directory sturcture [message #269898 is a reply to message #269892] Thu, 02 April 2009 01:29 Go to previous messageGo to next message
Eclipse UserFriend
"Billy " <billy_suh@yahoo.com> wrote in message
news:940d4780926aede0acdacf2dd9ab859d$1@www.eclipse.org...
> Hi, I have the following directory structure w/ JUNIT (which is not really
> relevant though)
>
> src
> com
> xyz
> SomeClass.java
> test
> com
> xyz
> SomeClassTest.java
>
> Unfortunately, within Eclipse, SomeClassTest cannot test SomeClass,
> because it cannot "see" SomeClass even though they are supposed to be in
> the same package com.xyz.


Make sure that both 'src' and 'test' are source folders (in Project
Properties -> Java Build Path). If you do that, then SomeClass and
SomeClassTest should behave just the same as if they were in the same folder
together.
Re: How make Eclipse work with packages in parallel directory sturcture [message #269932 is a reply to message #269898] Thu, 02 April 2009 22:40 Go to previous messageGo to next message
Eclipse UserFriend
It's resolved now. For some reason, I must go to
Project->Properties->Source tab->Add Folder... menu to add a new source
folder. Instead, I had manually created a folder called test from Windows
explorer. Even though Eclipse detected this directory and displayed it
under "Java Resources" in its Project Explorer, it didn't quite do it
right and exhibited the problem I originally described. Weird.
Re: How make Eclipse work with packages in parallel directory sturcture [message #269934 is a reply to message #269932] Thu, 02 April 2009 22:43 Go to previous message
Eclipse UserFriend
To elaborate: this was despite that the Project properties correctly
displayed it as a source folder. Anyways I am all set now. Thanks.
Previous Topic:Starting Eclipse issues.
Next Topic:3.4.2: code completion suddenly messed up?
Goto Forum:
  


Current Time: Thu Apr 24 23:10:51 EDT 2025

Powered by FUDForum. Page generated in 0.07483 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top