chaquo / chaquopy

Chaquopy: the Python SDK for Android
https://chaquo.com/chaquopy/
MIT License
762 stars 130 forks source link

Language Check: Error - Cannot Find Java #397

Closed Jpsese closed 3 years ago

Jpsese commented 3 years ago

I am currently importing language_check in my script but the problem is the pre requisite in order to be able to use language_check library is that you should have Java 8.0 version. What I want to ask is it necessary to put the SDK java in android studio project or is there any other solution to fix this problem.

FYR this it the exact error that I've encounter whenever I am running the script using android studio

PS: I can run the python script without no problem if I am running it on my machine since I have Java 8 sdk the problem is encountered whenever I run it in my android studio project.

Hoping to hear from you. Thanks

mhsmith commented 3 years ago

language_check works by running the LanguageTool JAR in a separate Java process and communicating with it over a pipe. Unfortunately Android devices don't come with a Java executable or any other way of executing a JAR, so there's no way language_check can work on Android without significant changes.

An alternative solution might be to download the LanguageTool JAR to your project's libs directory, so it'll be compiled into your app along with the rest of your Java code. Then you can call it directly from Java, or from Python using the Chaquopy Python API.

See the language_check source code and the LanguageTool documentation for more details.