Cannot import Eclipse classpath

Hi,  I'm trying to import some Eclipse projects into IDEA.  The projects were imported fine.  But I always got the error saying that the classpath contains unresolved Eclipse-style references. This is how the Eclipse .classpath file looks like:

    <classpathentry kind="lib" path="/Users/simon/workspace/shared/thirdparty/antlr/antlr-2.7.6.jar" />
    <classpathentry kind="lib" path="/Users/simon/workspace/shared/thirdparty/apache/commons/commons-collections-3.2.1.jar" />
    <classpathentry kind="lib" path="/Users/simon/workspace/shared/thirdparty/apache/commons/commons-dbcp-1.2.2.jar" />
    <classpathentry kind="lib" path="/Users/simon/workspace/shared/thirdparty/dom4j/dom4j-1.6.1.jar" />
    <classpathentry kind="lib" path="/Users/simon/workspace/shared/thirdparty/hibernate/3.2/hibernate3.jar" />
    <classpathentry kind="lib" path="/Users/simon/workspace/shared/thirdparty/mysql-connector/5.1.7/mysql-connector-java-5.1.7-bin.jar" />
    <classpathentry kind="lib" path="/Users/simon/workspace/shared/thirdparty/springframework/2.5.4/lib/junit/junit-4.4.jar" />
    <classpathentry kind="lib" path="/Users/simon/workspace/shared/thirdparty/easymock2.3/easymock.jar" />

If I changes IDEA to use .iml file to store dependencies, this is what it looks like:

    <orderEntry type="module-library">
      <library>
        <CLASSES>
          <root url="jar://?Users/simon/workspace/shared/thirdparty/antlr/antlr-2.7.6.jar!/" />
        </CLASSES>
        <JAVADOC />
        <SOURCES />
      </library>
    </orderEntry>
    <orderEntry type="module-library">
      <library>
        <CLASSES>
          <root url="jar://?Users/simon/workspace/shared/thirdparty/apache/commons/commons-collections-3.2.1.jar!/" />
        </CLASSES>
        <JAVADOC />
        <SOURCES />
      </library>
    </orderEntry>
    <orderEntry type="module-library">
      <library>
        <CLASSES>
          <root url="jar://?Users/simon/workspace/shared/thirdparty/apache/commons/commons-dbcp-1.2.2.jar!/" />
        </CLASSES>
        <JAVADOC />
        <SOURCES />
      </library>
    </orderEntry>
    <orderEntry type="module-library">
      <library>
        <CLASSES>
          <root url="jar://?Users/simon/workspace/shared/thirdparty/dom4j/dom4j-1.6.1.jar!/" />
        </CLASSES>
        <JAVADOC />
        <SOURCES />
      </library>
    </orderEntry>
    <orderEntry type="module-library">
      <library>
        <CLASSES>
          <root url="jar://?Users/simon/workspace/shared/thirdparty/hibernate/3.2/hibernate3.jar!/" />
        </CLASSES>
        <JAVADOC />
        <SOURCES />
      </library>
    </orderEntry>
    <orderEntry type="module-library">
      <library>
        <CLASSES>
          <root url="jar://?Users/simon/workspace/shared/thirdparty/mysql-connector/5.1.7/mysql-connector-java-5.1.7-bin.jar!/" />
        </CLASSES>
        <JAVADOC />
        <SOURCES />
      </library>
    </orderEntry>
    <orderEntry type="module-library">
      <library>
        <CLASSES>
          <root url="jar://?Users/simon/workspace/shared/thirdparty/springframework/2.5.4/lib/junit/junit-4.4.jar!/" />
        </CLASSES>
        <JAVADOC />
        <SOURCES />
      </library>
    </orderEntry>
    <orderEntry type="module-library">
      <library>
        <CLASSES>
          <root url="jar://?Users/simon/workspace/shared/thirdparty/easymock2.3/easymock.jar!/" />
        </CLASSES>
        <JAVADOC />
        <SOURCES />
      </library>
    </orderEntry>

Notice the question mark in front of Users/simon?  I have to convert that to a "/" for it to work.  But then I have to do that everything the classpath changes in Eclipse!  Isn't IDEA supposed to be able to use Eclipse's .classpath file?

Thanks,

Simon

5 comments
Comment actions Permalink

BTW, I'm using a Mac with IDEA 8 evaluation version.

0
Comment actions Permalink

Hi.

This looks like http://www.jetbrains.net/jira/browse/IDEADEV-15943
It is fixed in IDEA 9 (next version).

Alexander.

0
Comment actions Permalink

So there is no workaround in version 8?

0
Comment actions Permalink

No workaround with given content of .classpath file.

You could try to change "lib" entries to "var" ones. In Eclipse you need to do "Add variable" instead of "Add (external) jar". Then define the same path variable in IDEA.

Alexander.

0
Comment actions Permalink

That's too bad.  I guess I just have to edit those files myself.

Thanks.

0

Please sign in to leave a comment.