Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Env variable/home dir substitution in .classpath file
Env variable/home dir substitution in .classpath file [message #155172] Fri, 02 June 2006 19:24 Go to next message
Eclipse UserFriend
Originally posted by: vsimkus.uic.edu

Hi

Been banging my head against the wall with this one for a couple of
hours so any help would be much appreciated.

What I'm trying to do is get Eclipse to recognize environment vars in a
project's .classpath file. For example, here's one entry in a project's
..classpath file:

<classpathentry kind="lib" path="/opt/vic/jars/deps/torquelib.jar"/>

If I try to open this project on a different machine with a different
path layout I (understandably) get path errors. What I'd like to do is
put all the dependency jars in my home directory and change the class
path entry to use an environment var. In my head I'm seeing something
along the lines of shell expansion....

<classpathentry kind="lib" path="$HOME/jars/deps/torquelib.jar"/>

Is eclipse smart enough to do something like that?

Thanks in advance

Vic
Re: Env variable/home dir substitution in .classpath file [message #155259 is a reply to message #155172] Fri, 02 June 2006 20:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jefmyers.us.ibm.com

Vic,

I don't think that's supported - the best you can do is define a
classpath variable for your home directory in the preferences
(Window->Preferences->Java->Build Path->Classpath Variables) and have
your projects reference stuff relative to that variable. You can also
search for and log an enhancement request for this feature at
https://bugs.eclipse.org/bugs/

Hope this helps,
- Jeff
Re: Env variable/home dir substitution in .classpath file [message #155275 is a reply to message #155259] Fri, 02 June 2006 21:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vsimkus.uic.edu

Jeff Myers wrote:
> Vic,
>
> I don't think that's supported - the best you can do is define a
> classpath variable for your home directory in the preferences
> (Window->Preferences->Java->Build Path->Classpath Variables) and have
> your projects reference stuff relative to that variable. You can also
> search for and log an enhancement request for this feature at
> https://bugs.eclipse.org/bugs/
>
> Hope this helps,
> - Jeff

Hi, Jeff

Thanks for the response. Although the class path variables didn't do
quite what I want, your suggestion did give me an idea. Hopefully my
work-around will be helpful to someone...

I created a new project and dumped all of the jars into it. I then
pointed all of the other projects to the "dependency" project as a
source of jars. At this point all projects rely on jars relative to the
workspace - not the file system. I then put the "dependency" project
into CVS. This way, no matter which machine I'm using all I have to do
is checkout the shim project.

Is it a kludge? F*CK YEAH! Does it work? F*CK YEAH!
Re: Env variable/home dir substitution in .classpath file [message #155756 is a reply to message #155275] Tue, 06 June 2006 12:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse4.rizzoweb.com

Vic Simkus wrote:
> I created a new project and dumped all of the jars into it. I then
> pointed all of the other projects to the "dependency" project as a
> source of jars. At this point all projects rely on jars relative to the
> workspace - not the file system. I then put the "dependency" project
> into CVS. This way, no matter which machine I'm using all I have to do
> is checkout the shim project.
>
> Is it a kludge? F*CK YEAH! Does it work? F*CK YEAH!

Not a kludge at all. It is widely accepted that it is a good practice
to check into SCM (CVS, etc) everything necessary to build a project.
The goal should be to minimize the manual set-up required in order to
get a brand new developer/machine up to building/running the code. By
creating a "dependencies" project and checking it in, you have taken a
big step in that direction.

Eric
Re: Env variable/home dir substitution in .classpath file [message #155852 is a reply to message #155756] Tue, 06 June 2006 16:03 Go to previous message
Eclipse UserFriend
Originally posted by: vsimkus.uic.edu

Eric Rizzo wrote:

> Not a kludge at all. It is widely accepted that it is a good practice to
> check into SCM (CVS, etc) everything necessary to build a project. The
> goal should be to minimize the manual set-up required in order to get a
> brand new developer/machine up to building/running the code. By creating
> a "dependencies" project and checking it in, you have taken a big step
> in that direction.
>
> Eric

And there I thought I was so clever :)
Previous Topic:Joining Lines editor key
Next Topic:I don't seem to have " org.eclipse.jdt.core.tests" on my Eclipse platform (3.2)
Goto Forum:
  


Current Time: Fri Apr 26 13:56:38 GMT 2024

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

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

Back to the top