0
votes

I'm using eclipse and ant to compile a java project. The ant compile script calls javac using a classpath refid of classpath, which is set based on System Property variable java.build.path.

My java.build.path variable is missing a library that was specified in

Project->Properties->Java Build Path->Libraries.

That is, the external jar was properly added to the list of libraries to add to the build path, is not missing or corrupt, and I have every expectation that eclipse would include the library in the build path. My build fails because java.build.path is missing this library.

Furthermore, the file <projectDir>/.classpath contains a valid classpathentry element for the missing jar file.

When building, javac fails at an import statement, claiming that the package does not exist. The value of java.build.classpath contains many of the libraries I set in the project properties, but does not include the missing library. Its as if the project property for that external jar was never set.

For what its worth, the missing library is jboss/lib/jbosssx.jar

Any help here would be appreciated.

2

2 Answers

0
votes

At first,

  1. Download jbosssx.jar jar file from this link
  2. Then keep the jar file in the folder jboss/lib

Hope it will solve your issue.

UPDATE:

Sometimes jar files need to keep in lib folder physically. For this reason, you can put the jar file in your project lib folder.

0
votes

I found where my configuration was messed up.

Using External Tools Configurations within eclipse, I found another Classpath settings tab for my ant build that did not contain my library.

Adding my library here caused the build to succeed!

Skywalker, thanks for the suggestion. :)