Hi, 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
directory=FSDirectory.open(new 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 http://stackoverflow.com/questions/502960/eclipse-how-to-build-an-executable-jar-with-external-jar HTH Narayan On Sun, Feb 13, 2011 at 8:57 PM, Gong Li <ee07b...@gmail.com> 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 = FSDirectory.open(f); > > 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. >