IDEA 7.0 and Eclipse - variable in classpath

I'm working on a project where there are a few of the developers using IDEA and a large number of developers using Eclipse. I was very excited by the new feature in IDEA 7 of storing module dependencies in a .classpath file, since maintaining both IDEs' lists of jars is one of the ongoing headaches we have.

Here's my problem, though: directory structure.

Path variable P4_HOME is set to C:\depot on my computer, and probably something like D:\src on some other guy's computer.

The project is in:
P4_HOME/branch/project

so there are files .project, .classpath, branch.iml, and branch.eml in that directory, and it uses a jar in:
P4_HOME/branch/lib

Now, when we store the dependencies in IDEA format, branch.iml contains an entry like jar://$MODULE_DIR$/../lib/needed.jar. But when I store the dependencies in an Eclipse .classpath, I get an entry there like

Now, if I hand edit the file so that the line reads instead ]]>

then Eclipse can load the jar even on the other guy's machine. But when I then reload the project in IDEA, IDEA rewrites the classpath entry with an absolute path instead of the variable one.

Can anyone help me on this? I'd sure like to be able to use this feature!

2 comments

Hello Stephen,

I have also met this issue. Create, please, a JIRA issue.

I'm working on a project where there are a few of the developers using
IDEA and a large number of developers using Eclipse. I was very
excited by the new feature in IDEA 7 of storing module dependencies in
a .classpath file, since maintaining both IDEs' lists of jars is one
of the ongoing headaches we have.

Here's my problem, though: directory structure.

Path variable P4_HOME is set to C:\depot on my computer, and probably
something like D:\src on some other guy's computer.

The project is in:
P4_HOME/branch/project
so there are files .project, .classpath, branch.iml, and branch.eml in
that directory, and it uses a jar in:

P4_HOME/branch/lib

Now, when we store the dependencies in IDEA format, branch.iml
contains an entry like jar://$MODULE_DIR$/../lib/needed.jar. But when
I store the dependencies in an Eclipse .classpath, I get an entry
there like

<classpathentry kind="lib" path="C:\depot\branch\lib\needed.jar" />

Now, if I hand edit the file so that the line reads instead

<classpathentry kind="var" path="P4_HOME\branch\lib\needed.jar" />

then Eclipse can load the jar even on the other guy's machine. But
when I then reload the project in IDEA, IDEA rewrites the classpath
entry with an absolute path instead of the variable one.

Can anyone help me on this? I'd sure like to be able to use this
feature!

Alexander.


0

Please sign in to leave a comment.