Netbeans 6.8 , JDK 1.6 and Simple Validation API

2019-07-21 02:49发布

问题:

I am using Netbeans 6.8 , JDK 1.6 and downloaded Simple Validation API. When I try the code, it gives me errors referencing "org/openide" classes.

Could this be a compatibility issue? How can I resolve this?

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/openide/util/Lookup
        at org.netbeans.validation.api.ui.swing.SwingComponentDecorationFactory.getDefault(SwingComponentDecorationFactory.java:154)
        at org.netbeans.validation.api.ui.swing.SwingValidationGroup.<init>(SwingValidationGroup.java:82)
        at org.netbeans.validation.api.ui.swing.SwingValidationGroup.create(SwingValidationGroup.java:87)

回答1:

Add "nbstubs.jar" to your classpath. Download "All Sources" from https://kenai.com/projects/simplevalidation/downloads and find it in validation-src.zip\nbstubs\dist.