01: /* Copyright 2001, 2004 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.tools;
07:
08: public class LibCheck {
09:
10: /**
11: * Class that checks that JAXP is present in the JVM. This allows us to give a
12: * useful error back to the user if we find JAXP missing instead of getting many of
13: * class not found errors the user will see a message instructing them how to fix
14: * the problem.
15: */
16: public LibCheck() {
17: super ();
18: }
19:
20: public static void main(String[] args) {
21: String importantClass = "javax.xml.xpath.XPathConstants";
22: try {
23: Class c = LibCheck.class.getClassLoader().loadClass(
24: importantClass);
25: } catch (ClassNotFoundException e) {
26: System.err.println(e);
27: System.err
28: .println("The missing class is provided as part of JAXP.\n"
29: + "Check that you have the JAXP jars installed in your JDK.\n"
30: + "For more information see lib/jaxp/README.txt.");
31: System.exit(1);
32: }
33: System.exit(0);
34: }
35: }
|