Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Setting Advanced Default Classpath
Setting Advanced Default Classpath [message #63986] Fri, 13 May 2005 16:44 Go to next message
Eclipse UserFriend
Originally posted by: igray.austinlogistics.com

In the Run->Run... dialog, on the Classpath tab, after clicking User
Entries, I can click the Advanced button to add folders to my runtime
classpath. My application uses various folders added to the classpath to
find load files using the ClassLoader.getResourceXXX() methods.

Is there a way to define these folders by default so that I don't have to
set them again every time I create a new run configuration? For example, I
like to run my unit tests individually, and every time I run a new unit
test class, it creates a new run configuration for that class.

I noticed that on the Classpath tab mentioned above, there is a "Restore
Default Entries" button-- where is it getting those defaults from?

I have tried adding these folders to the Java Build Path under my project
settings, but some of these folders are nested within another and it
complains when I try to add them. For example, it won't let me add both
"myproject/" and "myproject/etc/".

Any ideas? Thanks in advanced.

Iain
Re: Setting Advanced Default Classpath [message #64078 is a reply to message #63986] Fri, 13 May 2005 22:42 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse.rizzoweb.com

Iain Gray wrote:
> In the Run->Run... dialog, on the Classpath tab, after clicking User
> Entries, I can click the Advanced button to add folders to my runtime
> classpath. My application uses various folders added to the classpath to
> find load files using the ClassLoader.getResourceXXX() methods.
>
> Is there a way to define these folders by default so that I don't have to
> set them again every time I create a new run configuration? For example, I
> like to run my unit tests individually, and every time I run a new unit
> test class, it creates a new run configuration for that class.

One thing you can do is to create a baseline or prototype run
configuration, then just copy/duplicate that one when you want to create
a new one. The copy will get the settings from the baseline/prototype.
Not ideal, but one possible work-around.


> I noticed that on the Classpath tab mentioned above, there is a "Restore
> Default Entries" button-- where is it getting those defaults from?

From the build/compile classpath settings for the Project.


> I have tried adding these folders to the Java Build Path under my project
> settings, but some of these folders are nested within another and it
> complains when I try to add them. For example, it won't let me add both
> "myproject/" and "myproject/etc/".
>
> Any ideas? Thanks in advanced.

Remember that classpaths are recursive. IOW, adding both myproject/ and
myproject/etc/ doesn't make sense because myproject/etc/ is a part of
myproject/ already. That is why Eclipse won't let you add both to the
Project classpath. If you have files in myproject/etc/ that you want to
be on the classpath, you can include just myproject/ and the refer to
the files under etc/ by prefixing their names with etc. This is how
package-based file references work (for example, a class
com.foo.SomeClass can load a file through its classloader by referring
to the file resource location as com/foo/someFileName).

HTH,
Eric
Previous Topic:eclipse gets progressively slower on macosx10.4
Next Topic:Eclipse 3.0.2 could not start on the ext filesystem
Goto Forum:
  


Current Time: Fri Jul 19 07:23:32 GMT 2024

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

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

Back to the top