Xerces
843810Nov 5 2002 — edited Jan 3 2006First time using the Java SDK (1.4.0_02) on a Linux system
and am having a compile problem. Simple HelloWorld app works
easily enough but I have installed Xerces to provide XML
capabilities.
Hello.java utilizing the DOMParser looks like this:
import java.io.IOException;
import org.apache.xerces.parsers.DOMParser;
class Hello {
public static void main(String[] args) {
System.out.println("Hello " + args[0] + "!");
}
}
Compiling with javac produces:
Hello.java:2: package org.apache.xerces.parsers does not exist
import org.apache.xerces.parsers.DOMParser;
^
1 error
CLASSPATH has been set as /opt/xerces-1_4_4/xerces.jar
which is correct.
Analysis of the xerces.jar file with the jar utility reveals that
org.apache.xerces.parsers.DOMParser does exist in the package.
I have chmoded the xerces.jar file to allow execute for all groups
but this had no effect.
I'm not sure whether the error message suggests that DOMParser does
not exist or that xerces.jar is not being recognized (maybe a
CLASSPATH problem).
Any suggestions would be appreciated.