开发者

Add Jars to User LIbraries in Eclipse Helios, Mac OSX

I've created a new Java project (testProject) and begin to add jars to a user library, but I'm getting project errors after adding jars to a "User Library"

Here's what I'm doing:Create the User Library

  1. Right mouse click the project and click Properties
  2. Click Add Libra开发者_开发问答ry..., select User Library, and click Next
  3. Click button, User Libraries...
  4. Click New... and give it a name: mule; click OK.
  5. Select mule and click Add JARs...
  6. Add a jar (e.g. I've added two, one from the root project, log4j.jar, and another from /opt/mule/lib)
  7. Click OK
  8. Click Finish

Now I'm seeing a red x show on the mule library. 1. Click Edit, and click User Libraries 2. The message on each jar says the library is missing, and it seems to be losing the actual path.

See attached image:

Add Jars to User LIbraries in Eclipse Helios, Mac OSX

I'm running On a Mac OSX 10.5.8, running Java openjdk version "1.6.0-internal" OpenJDK Runtime Environment (build 1.6.0-internal-landonf_17_may_2009_13_58-b00) OpenJDK Client VM (build 11.0-b17, mixed mode)

This doesn't seem to be a problem on a Vista PC, running Eclipse on Java 1.6.0_16. (Or under Ubuntu).

Is anyone else seeing this?


I have had a similar problem in Eclipse Indigo SR2 on a Windows XP workstation. It ran perfectly for a long time until it broke and displayed the behavior that the OP has observed.

I have found out more what causes the problem and have found a workaround.

The problem is caused when I choose Preferences -> Java -> Build Path -> User Libraries | Add JARS... and add a new jar file. What happens is that although the user library is given an absolute path (C:\Documents and Settings\a23456\box_corefx\1box-corefx\box-build\target\deployment\weblogic\APP-INF\lib\antlr-2.7.6.jar) it only stores a relative path (\1box-corefx\box-build\target\deployment\weblogic\APP-INF\lib\antlr-2.7.6.jar). This relative path is what makes it say "missing."

The workaround is to export a good user library and massage the jars so that it has entries like:

<archive path="C:/Documents and Settings/a23456/box_corefx/1box-corefx/box-build/target/deployment/weblogic/APP-INF/lib/antlr-2.7.6.jar"/>

Then import the new user library.


There have been a number of problems reported by people trying to run Eclipse on Open JDK. Plus it looks like you are using some sort of pre-production build of it. The first thing I'd do is to try running Eclipse with JDK that comes with Mac OSX.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜