답 일지 몰라도 답답함은 해결되길

IT

[IT] Installing JEP on AWS EC2 Amazon Linux Instance.

아담도라이바 2020. 9. 29. 09:28
반응형

I don't know if it's common to use Python in the WEB composed of JSP and JAVA, but in the recent project
I needed a function to run python scripts in JAVA and get a result value.

Previously, I analyzed which one of "Jython" and "JEP" fits the project, and finally selected JEP, and explains how to install JEP on Linux.

jep vs Jython

 

[기술] JEP과 Jython

"Java + Groovy 로 진행되던 프로젝트인데 클라이언트의 요청으로 Groovy 스크립트를 Python으로 교체해야 한다." 입에 개거품 물고 달려드는게 맞지만.. 어차피 나중에 나올 이야기라면, 지금 해결하는

lifeinno.tistory.com

github.com/ninia/jep

 

ninia/jep

github.com

www.jython.org/

1. Installation of the Open JDK

This is too easy for a developer, so replace it with a command.

(Above all, you need to install a JDK that you want and that JEP supports.)

"sudo yum install -y jasudo yum install –y java-1.8.0-openjdk-devel.x86_64"

 

 

2. Set the "JAVA_HOME" Variable

To install JEP, You will need to set an environment variable to the Your Java installation directory.

"sudo su"
"vi /etc/profile"
"export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.xxx.b10-0.amzn2.0.1.x86_64/"

$JAVA_HOME
Check $JAVA_HOME

3. Installation of the Python3 and Python3-devel

Install Python for JEP execution. If this is the caIt is recommended to install Python version 3. Because I have no experience with version 2. ㅡㅡ......

"sudo yum install python3"

"sudo yum install "python3-devel"

If you try to install "JEP" without installing "Python-devel", an error saying "Python.h" does not exist is displayed.

python.h Error

4. Installation of the GCC

Install the compiler required to run Python scripts with User Privilege.

"sudo yum install gcc"

 

5. Installation of the JEP

Install the necessary programs and install Jep.  Change the account to root and execute below.

“python3 –m pip install jep”.

When the installation is completed normally, the location where “jep” is installed is as follows.

/usr/local/lib64/python3.7/site-packages/jep

If the installation is successful, the console window will be displayed as if you had entered “jep” in the user account.

 

 

Next time, we will look at tomcat setting for jep operation.

To be continue...

반응형