0

I want to create a Python app in Azure App Service. The code involves module language-check, which requires Java. I am wondering how I could install Java in Azure App Service. Thanks!

1
  • My answer has been updated, creating a webapp and choosing linux will solve your problem. If you choose windows, there will be an error of installing language_check without permission (found during webjob testing). Commented Dec 23, 2020 at 6:34

1 Answer 1

1

UPDATE

It is recommended to choose linux platform to create web app.

Run below command in webssh.

Step 1. apt-get update

Step 2. apt-get install openjdk-8-jdk

Step 3. java -version

Step 4. pip install language_check

enter image description here

After trying, I found in windows webapp that although the webapp contains a java environment, when executing tool = language_check.LanguageTool('en-US'), an error language_check.JavaError: can't find Java will be reported.

In windows webapp.

enter image description here enter image description here

When you create a webapp, no matter what language environment you choose, when the creation is complete, in the azure web app, all language environments are included by default.

Suppose you create a webapp based on the node language of windows, then you can create virtual applications in other languages such as java, .net, python etc., all of which are supported, which I have tested.

Sign up to request clarification or add additional context in comments.

6 Comments

Thanks you so much!! Sorry but I still have no idea about how to specify the correct Java path. Could you kindly help me with that, too? I tried to add java_path = 'C:\Program Files\JavaConfigTransformer\bin\java.exe' in the init.py of language_check. However, seems that it did not work. Really appreciate that.
@SuofeiWu You don't need to install java in azure web app. My answer just show you webapp you created has java environment.
@SuofeiWu Which platform you use, windows or linux ?
@SuofeiWu If you must use windows, it is recommended to use Docker Container to create a webapp.
@SuofeiWu In linux, you can try to install it by pip install language_check manually. In windows, I also try to run the command, but failed.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.