Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » file paths for debugging vs production
file paths for debugging vs production [message #251408] Thu, 14 February 2008 11:27 Go to next message
Eclipse UserFriend
Originally posted by: beeky.bellatlantic.net

I want to debug a single Java class that will be reading files from
several different directories. My project source tree looks like:

FileProcessor

classes
src
java
FileProcessor.java
testFiles
SourcesA
file 1 etc.
SourcesB
file 1 etc.

I use Ant to create a distribution directory that looks like:
dist
FileProcessor.class
SourcesA
file1 etc.
SourcesB
file2 etc

When I debug in Eclipse the root file path is
C:\eclipse-SDK-3.2-win32\workspace\FileProcessor

I want the root path to be
C:\eclipse-SDK-3.2-win32\workspace\FileProcessor\dist

Is this possible?

Thanks for any help or advice,
-=Beeky
Re: file paths for debugging vs production [message #251413 is a reply to message #251408] Thu, 14 February 2008 14:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Beeky wrote:
> I want to debug a single Java class that will be reading files from
> several different directories. My project source tree looks like:
>
> FileProcessor
>
> classes
> src
> java
> FileProcessor.java
> testFiles
> SourcesA
> file 1 etc.
> SourcesB
> file 1 etc.
>
> I use Ant to create a distribution directory that looks like:
> dist
> FileProcessor.class
> SourcesA
> file1 etc.
> SourcesB
> file2 etc
>
> When I debug in Eclipse the root file path is
> C:\eclipse-SDK-3.2-win32\workspace\FileProcessor
>
> I want the root path to be
> C:\eclipse-SDK-3.2-win32\workspace\FileProcessor\dist
>
> Is this possible?

Note: this is not really an Eclipse-specific question; it should really
be asked on a general Java forum.
If you read your files via Class.getResource() or
Class.getResourceAsStream(), then the paths are relative to the
application's classpath and you don't have to worry about the absolute path.

Hope this helps,
Eric
Re: file paths for debugging vs production [message #251429 is a reply to message #251413] Thu, 14 February 2008 16:23 Go to previous message
Eclipse UserFriend
Originally posted by: beeky.bellatlantic.net

Eric,

Thanks for the reply, it helped a lot. I didn't realize that you could
read files with the Class class. That really simplifies things.

-=beeky
Previous Topic:Remote Debugging over VPN
Next Topic:Programmatically opening Junit test case creation wizard
Goto Forum:
  


Current Time: Tue Apr 22 13:42:29 EDT 2025

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

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

Back to the top