Apache Lucene을 사용하는 Java 파일을 실행하는 데 문제가 있습니다.Java Lucene Classpath 문제 우분투
내 클래스 패스에 .jar 파일을 가지고 있지만 난의 .class 파일을 실행하려고 할 때, 내가하지 않으면이 오류가 얻을,이 매개 변수 -classpath .:lucene-core.x.x.jar
를 추가해야하기 때문에 나는 그것을 컴파일 할 수
Exception in thread "main" java.lang.NoClassDefFoundError: HelloLucene
Caused by: java.lang.ClassNotFoundException: HelloLucene
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: HelloLucene. Program will exit.
클래스 경로도 jvm에 추가해야합니까? 그렇다면 어떻게해야합니까? 발견되지 년대 클래스는 클래스 즉 HelloLucene
을
[email protected]:~/Desktop/lucene/Indexer$ echo $CLASSPATH
/home/ricardo/lucene-3.4.0/lucene-core-3.4.0.jar:/home/ricardo/lucene-3.4.0/contrib/demo/lucene-demo-3.4.0.jar
당신이 어떤이에 대한 IDE 또는 콘솔에 일을 사용하고 있습니까? – gprathour
Netbeans를 사용하면 작동하지만 콘솔을 사용할 때는 작동하지 않습니다. – rkrdo