1

I am trying to include an apache fop jar file to a java classpath. The Java file has to include some fop stuff like below:

import org.apache.fop.apps.Driver;
import org.apache.fop.apps.Options;

And all files I have is fop.jar and FOPWrapper.java. When I try to compile with the following line: javac -cp ".;*.jar" FOPWrapper.java I still get compiler errors.

FOPWrapper.java:1: error: package org.apache.fop.apps does not exist
import org.apache.fop.apps.Driver;
                      ^
FOPWrapper.java:2: error: package org.apache.fop.apps does not exist
import org.apache.fop.apps.Options;

How am I then supposed to include the jar file so that it compiles?

Charl Meyers
  • 115
  • 1
  • 8
  • Did you try with the full names of the jars? – YoungHobbit Dec 26 '15 at 13:15
  • in your -cp option, please try giving full path of your jar files. – SMA Dec 26 '15 at 13:16
  • 2
    Possibly this link can help http://stackoverflow.com/questions/9395207/how-to-include-jar-files-with-java-file-and-compile-in-command-prompt – Shriram Dec 26 '15 at 13:16
  • Besides Shriram's general advice, I would recommend checking whether the version of FOP your code was made for matches the one of the jars you are trying to use (the use of the `Driver` class makes me think your code refers to FOP 0.20.5 which is **really** old; the current version is 2.0 and was released in June 2015). – lfurini Dec 27 '15 at 13:56

0 Answers0