Hi

I managed to setup lsp and java for emacs. I can compile and all works fine.

I set compile command in init.el to run javac and java command so I see the result, as below.

(setq compile-command "javac YourJavaFileName.java && java YourJavaClass")

For now I have to replace “YourJavaClass” with current class. Can anyone help me to automatically pass currently opened class name to that command, please?

Thanks!