lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From narayan bhati <>
Subject Re: About FSDirectory, File
Date Sun, 13 Feb 2011 20:00:34 GMT
you can export index with jar itself
and do not provide absolute path relative to file system
instead create folder named index in your project space
then as below you can get index directory File("index"));

here path is relative to you workspace which will not mess up, when you send
jar to other systems
eventually when you export project as jar or so, it will create folder named
index for index files.
 below is link for exporting and related stuff


On Sun, Feb 13, 2011 at 8:57 PM, Gong Li <> wrote:

> Hi,
> I need to generate executable JAR.
> In my code, it has some lines as following:
> String path = "d:\\project\\";
> File f = new File(path);
> Directory dir =;
> In the path, there is a wordnet index which is used to search by synonyms.
> When I run the JAR, it needs local directory d:\project in my computer. So
> how to do to wrap the directory and the files in it into JAR that the
> program can run independently.
> Thx.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message