Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

conflicting classes: how to override with --classpath

  Asked By: Dora    Date: Jun 10    Category: Java    Views: 1342

I have several newer jar files that seem to conflict with newer jar
files and are causing java runtime errors.

The conflict occurs with fop.jar (part of apache.org).

If I run the fop.jar using the bash script provided by apace, I have no
problems. The bash script finds the jar files it provided and puts them
at the beginning of the CLASSPATH. My CLASSPATH then looks something
like this:

fop.jar:other fop libraries:rest of jar files

The bash script then executes the command by
java -classpath <new class path> org.apache.fop.apps.Fop <commands>

This works fine.

But if I try to embed fop in my own java applications, I run into
problems. I conclude that when I run java, it is loading the first
classes it finds (for example xalan), and these classes act differently
than what fop expects.

I tested this theory out by removing the --classpath from the command
above. I got an error.

So is there a way to set --classpath within a java program?

Also, is this conflict really a bug, and should I report it to Apache?



No Answers Found. Be the First, To Post Answer.

Didn't find what you were looking for? Find more on conflicting classes: how to override with --classpath Or get search suggestion and latest updates.