Let's say that I have a makefile in ./ and a file ./package/myclass.java. From ./, make works just normally, but using flymake-mode in Emacs, I always get the error

Flymake: No buildfile (Makefile) found for </absolute/path/to/myclass.java>. Flymake will be switched OFF.

The flymake manual says something about a customizable variable called flymake-buildfile-dirs, but this variable actually doesn't exist. I tried cd to ./, and to add ../ to flymake-master-file-dirs, which didn't help either.

The strange thing is that on my Macbook, this works with the same configuration, while on my Debian GNU/Linux Desktop, it doesn't. Does anyone have an idea?

  • Flycheck has no Java support. – Monkey Supersonic Oct 25 '14 at 9:30
  • He's using flymake. – RichieHH Mar 16 '19 at 7:17
  • "He" is the poster himself answering a deleted comment stating that I should use flycheck instead. – Monkey Supersonic Mar 17 '19 at 9:18

I finally found out what was wrong. I simply re-wrote the makefile, which was initially written on my Macbook, on a different Computer. Flymake is now working correctly. I guess there was a problem with the character encoding.

EDIT: I forgot to mention that I renamed it from makefile to Makefile. I tried renaming it back and the same error message came up. So I reverted it again to Makefile and flymake works. Very strange.

  • It has nothing to do with character encoding. It's the renaming of the file that fixed Flymake, because Flymake explicitly only looks for Makefile, not for makefile or other names (e.g. GNUmakefile). This is even mentioned in the commentary of flymake.el, right at the top. See Emacs bug 18682 – user227 Nov 29 '14 at 10:20

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.