I am working on a project that requires me to understand the basics of the Apache Jakarta Regexp package for Java. I am somewhat unfamiliar with how to inlcude libraries in a java class. This is what im trying to run:
import org.apache.regexp.*;
public class regexpTest {
public static void main(String[] args) {
RE r = new RE("a*b");
boolean match = r.match("aabb");
if (match){
System.out.println("yes");
}
else{
System.out.println("no");
}
}
}
I have added Documents\jakarta-regexp-1.5\jakarta-regexp-1.5.jar to my class path, but i get to get it to compile without errors, i have to use:
javac -classpath …\jakarta-regexp-1.5\jakarta-regexp-1.5.jar regexpTest.java
that will compile, but when i try to run it like this :
java -classpath …\jakarta-regexp-1.5\jakarta-regexp-1.5.jar regexpTest
I get an error: “Exception thread “main” java.lang.NoClassDefFoundError: regexpTest”
Any ideas on what im doing wrong?
Is the current directory in your classpath?
http://download.oracle.com/javase/6/docs/technotes/tools/windows/classpath.html