ICTRC / Parsivar

A Language Processing Toolkit for Persian
MIT License
226 stars 34 forks source link

NLTK was unable to find the java file! #11

Closed hosseinhimself closed 3 years ago

hosseinhimself commented 3 years ago

I had this error while using POSTagger:

LookupError:

NLTK was unable to find the java file! Use software specific configuration paramaters or set the JAVAHOME environment variable.

and I tried this code but didn't work:

import os
java_path = "C:/Program Files/Java/jre1.8.0_281/bin/java.exe"
os.environ['JAVAHOME'] = java_path

There was no problem running this code on Ubuntu, but this is the case when I'm using Windows.

hosseinhimself commented 3 years ago

I found the problem and fixed that. Check this out: https://stackoverflow.com/questions/66480733/parsivar-nltk-was-unable-to-find-the-java-file