在java类路径中设置lucene jar文件
我是 lucene 的新手,入门时遇到困难。
请遵循 http://lucene.apache.org/java/3_3_0/demo 上的初学者指南。 html 我正在尝试设置类路径,从 http://download.oracle.com/javase/1.3/docs/tooldocs/win32/classpath.html。
这是我在命令行中输入的内容:
C:\Users\k>java -classpath C:\Users\k\Downloads\lucene-3.3.0\contrib\demo\lucene-demo-3.3.0.jar;C :\Users\k\Downloads\lucene-3.3.0\lucene-core-3.3.0.jar
它返回可与 java 关键字一起使用的选项列表。
我做错了什么?
I'm new to lucene and is having trouble getting started.
Following the beginners guide at http://lucene.apache.org/java/3_3_0/demo.html i'm trying to set the classpath, copying the syntax from http://download.oracle.com/javase/1.3/docs/tooldocs/win32/classpath.html.
this is what I entered in the command line:
C:\Users\k>java -classpath C:\Users\k\Downloads\lucene-3.3.0\contrib\demo\lucene-demo-3.3.0.jar;C:\Users\k\Downloads\lucene-3.3.0\lucene-core-3.3.0.jar
It returns a list of options usable with the java keyword.
What am i doing wrong ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你需要类似的东西
看起来你正确设置了类路径,之后你需要做的就是 org.apache.lucene.demo.IndexFiles 告诉 JVM 哪个是主类应用程序和
-docs {path-to-lucene}/src
是传递到 lucene 演示中的参数。You need something along the lines of
It looks like you set the classpath correctly, all you needed to do after that was
org.apache.lucene.demo.IndexFiles
which tells the JVM which is the main class of the application and-docs {path-to-lucene}/src
is an argument passed into the lucene demo.您使用的命令不是用于设置类路径。它是用于运行java类文件的
java
命令。您为其提供一个类路径参数,该参数确定从何处加载类文件。要设置类路径,请在 Windows 上使用此命令:
set CLASSPATH=classpath1;classpath2...
因此,如果您仍想使用带有 -classpath 参数的 java 命令,请在命令末尾指定一个类名,即课程将像这样运行
The command you are using is not for setting class path. It is the
java
command used to run java class file. You are providing it a class path arguments which determines from where to load class files.To set classpath use this command on windows:
set CLASSPATH=classpath1;classpath2...
So if you want to still use java command with -classpath argument then specify a class name at the end of command which is the class going to be run like