Apache Thrift installation issue

1- How can I put thrift in the PATH variable ??

2- I want to install thrift in my home space to build a machine learning app.
but I have this stack error:::

/home/userpro/thrift/lib/java/build.xml:99: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to “/usr/lib/jvm/java-1.8.0-openjdk-”

Thank you a lot