如何在类路径中包含多个类文件和.Jar文件,我在linux上...并希望集成使用我的代码下载的lucene软件包,所有库和类文件都在lucene dirc中。 (它们是该文件夹中的多个子目录)?
HelloLucene.java:1: error: package org.apache.lucene.analysis.standard does not exist
import org.apache.lucene.analysis.standard.StandardAnalyzer;
^
HelloLucene.java:10: error: package org.apache.lucene.queryparser.classic does not exist
import org.apache.lucene.queryparser.classic.ParseException;
^
HelloLucene.java:11: error: package org.apache.lucene.queryparser.classic does not exist
import org.apache.lucene.queryparser.classic.QueryParser;
^
HelloLucene.java:23: error: cannot find symbol
public static void main(String[] args) throws IOException, ParseException {
^
symbol: class ParseException
location: class HelloLucene
HelloLucene.java:26: error: cannot find symbol
StandardAnalyzer analyzer = new StandardAnalyzer(Version.LUCENE_40);
^
symbol: class StandardAnalyzer
location: class HelloLucene
HelloLucene.java:26: error: cannot find symbol
StandardAnalyzer analyzer = new StandardAnalyzer(Version.LUCENE_40);
^
symbol: class StandardAnalyzer
location: class HelloLucene
HelloLucene.java:45: error: cannot find symbol
Query q = new QueryParser(Version.LUCENE_40, "title", analyzer).parse(querystr);
^
symbol: class QueryParser
location: class HelloLucene
Note: HelloLucene.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
7 errors
答案 0 :(得分:0)
使用以下命令:
export CLASSPATH="$CLASSPATH:xyz.jar**:**path_to_abc.jar.jar"
您基本上必须附加到类路径,您想要的所有新条目。要做到这一点,只需在linux中使用':'和';'在Windows中。
答案 1 :(得分:0)
您只需将路径添加到罐子所在的文件夹中,然后递归选择内部罐子。