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:::

BUILD FAILED
/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-1.8.0.111-1.b15.el7_2.x86_64/jre”

Thank you a lot