Hello, I have a code like this:
public static void main(
String argv[]) {
System.out.println("balanceDate: " + DatatypeConverter.parseDate("2011-01-01"));
}
I can run this code on two machines with no problem (either from Eclipse or from commandline).
On third machine, this code fails with
Exception in
thread "main" java.lang.NullPointerException
at javax.xml.bind.DatatypeConverter.parseDate(Unknown Source)
at ReadXMLFile.main(ReadXMLFile.java:19)
This is the
java version on the third machine (JRE only):
Z:\>java -version
java version "1.6.0_02"
Java(TM) SE Runtime Environment (build 1.6.0_02-b06)
Java HotSpot(TM) Client VM (build 1.6.0_02-b06, mixed mode, sharing)
The other two machines have java 1.6.0_26 JDK.
Q: Do I need JDK to run this code? Why doesn't it work with JRE? Do I need to add some .JARs?
Thanks!