Ensime for .java files inside android project

216 views Asked by At

I have a very basic question about enabling ensime in .java files inside android project (basically its what suppose to be enjine mode as I understood) from emacs.

So I added plugin { id 'org.ensime.gradle' version '0.2.8' } inside my build.gradle in root of my android project, generated .ensime file in project root and after invoking ensime from inside emacs with MainActivity.java file opened - it started ensime server successfully, and changed .java file major mode to ensime Disconnected. But no matter what I do looks like I can not connect to running server.

A also tried to generate new android blank project from scratch with sbt and sbt gen-android and tried to run inside that project root folder sbt ensimeConfig and sbt ensimeConfigProject - no difference, main.scala after enabling ensime-mode in it works great, if I try to enable ensime-mode in some .java file from that project, like MainActivityTest.java - the same as described upper - disconnected and no ensime functionality.

1

There are 1 answers

0
sandric On

Ok, looks like I found answer - its basically duplication of this. All what needed to do is to add :compile-jars (" [...] /local/share/java/android-sdk-mac_x86/platforms/android-10/android.jar") to .ensime file.