0

Trying to run a simple java code in atom editor but giving the error: bash javac command not found.

Tried to set the path as follows but does not resolve the problem:

[root@localhost ~]# export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el7_4.x86_64 
[root@localhost ~]# export PATH=$JAVA_HOME/bin:$PATH

Here is the screenshot of my centos terminal and in background, the atom editor showing error

1

Run this command su -c 'yum provides javac'
This will tell you what packages will provide javac

Just because you installed a java RE doesn't mean you have a Java DK Install java-devel or java-1.8.0-openjdk-devel or whatever version you want.

  • Thanks, I was missing just one line of command. Here it goes. sudo yum install java-1.8.0-openjdk-devel. And worked fine now. – Palak Garg Agarwal Dec 11 '17 at 14:50
  • @PalakGargAgarwal Mark it as 'best answer' so it is resolved. – PuzzledCuber Dec 12 '17 at 15:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.