Paweł
Paweł

Reputation: 156

Migrate Lucene from java 1.8 to 1.6 Path FSDirectory

I have a working application on java 1.8, but I have to change this in java 1.6 because there are no:

import java.nio.file.Path;
import java.nio.file.Paths;

Path path = Paths.get(indexLocation); Directory index = FSDirectory.open(path);

I found old code example there was

Directory index=FSDirectory.open(new File(indexLocation));

But now .open() needs Path as parameter. How to resolve this?

Upvotes: 0

Views: 356

Answers (1)

Simona R.
Simona R.

Reputation: 598

If you have java 6 you must use Lucene library version < 4.8.

From Lucene 4.8, java 7 is required. This is the link of the system requirements: lucene 4.8 change log

Upvotes: 1

Related Questions