0

I am new to Sublime Text 3 and I want to run and compile java code on Sublime Text 3. However, I am getting this weird error:

/bin/bash: javac: command not found [Finished in 0.0s with exit code 127]

and my file in /home/***/Downloads/sublime_text_3/Packages/Java.sublime-package/JavaC.sublime-build looks like :

{
   "shell_cmd": "javac \"$file\" && java \"$file_base_name\"",
   "file_regex": "^(...*?):([0-9]*):?([0-9]*)",
   "selector": "source.java",
}

OS: Ubuntu 16.04 LTS 64bit
sublime version: Sublime Text 3.0 build 3143

any suggestions are welcome.

1 Answers1

1

This error says that you have no javac installed (which actually is a part of JDK). By default Ubuntu is not bundled with JDK. So you have to install it manually:

$ sudo apt-get install default-jdk

You can verify that javac is present:

$ which javac
/usr/bin/javac

If you see the path to you java compiler everything should work.

Yevhen Danchenko
  • 1,039
  • 2
  • 9
  • 17