Questions tagged [java]

Java is a programming language. Use this tag for all questions on how to use emacs to work with Java code.

Filter by
Sorted by
Tagged with
0
votes
0answers
8 views

How to utilise use-package with java-mode?

I am trying to use use-package with Emacs built-in major mode for Java. Here is the code, (use-package java-mode :bind (:map java-mode-map ("C-c C-c" . (lambda () (interactive) (message "I ...
0
votes
0answers
9 views

How to generate .eclim configuration file on project root directory

I am trying to use eclim-java-run-run function, and this error comes up: Debugger entered--Lisp error: (file-missing "Opening input file" "No such file or directory" "~/eclipse-workspace/...
0
votes
1answer
494 views

Are there any tutorials/documentation for lsp-java?

I have managed to install lsp-java according to their git Readme (https://github.com/emacs-lsp/lsp-java) and created my workspace. Is there a better way (eg. in form of a documentation or tutorial) ...
1
vote
1answer
434 views

Ensime plugin causes sbt error: “You must explicitly set JDK_HOME or JAVA_HOME”

Spacemacs: 0.200.7 Emacs: 25.3.1 sbt: 1.2.0 Java: openjdk version "1.8.0_171" .sbt/1.0/plugins/plugins.sbt: addSbtPlugin("org.ensime" % "sbt-ensime" % "2.5.1") ...
1
vote
0answers
44 views

Emacs doesn't use macOS's /etc/launchd.conf env variables

Emacs doesn't use macOS's /etc/launchd.conf env variables. I have the following there: function addToPATH { case ":$PATH:" in *":$1:"*) :;; # already there *) PATH="$1:$PATH";; # ...
0
votes
1answer
310 views

format java source code natively based on CodeFormatterProfile

Is there an emacs tool to format java code according to a Java Code Formatter Profile (xml) spec, such as the one below? https://github.com/google/styleguide/blob/gh-pages/eclipse-java-google-style....
2
votes
3answers
779 views

LIGHTWEIGHT Java Environment (not JDEE)

Is there a lightweight Java environment for EMACS? I have used JDEE in the past, but it's accumulated a lot of, ahem, features since I used it last, and just trying to set it up has consumed a couple ...
1
vote
0answers
81 views

Constrain Eclim to java files

I am using eclim and I am loving it! But I had to disable eclimd-autostart because it keep trying to fire up eclimd when I pop a .js buffer. Autostarting of eclimd is disabled, please start eclimd ...
3
votes
0answers
27 views

How to specify the (sub)directory for source and compiled files when evaluating Java codeblocks in org mode?

I use Org Mode with Java codeblocks. When I evaluate a codeblock the source files and the compiled files (*.class) are saved in the same directory as the Org file with the codeblocks. How can I ...
0
votes
0answers
71 views

use-package - load package depending on the OS username

I am not a Java guy at all, but I mess with it quite often for university reasons. I have used this awesome post by peter goldsborough to set up eclim. Which is nice! But this also requires a lot of ...
1
vote
1answer
148 views

JDEE runs maven all the time

I am opening a Java source file which is part of a maven project. JDEE now runs maven once, which I can sort of understand. But whenever I move around in the file, it will trigger once more. Since it ...
0
votes
1answer
598 views

How to indent PHP code in PHP-mode?

I come from Java/Netbeans, and I can indent my Java code using alt+shift+f, I have searched through this site and other articles, but I didn't find a good way to indent PHP. What I found: using ...
1
vote
0answers
73 views

Eclim problems not being highlighted/problems not being shown in minibuffer

I know I have eclim setup correctly because everything else works, I.E I can do autocomplete, jump to definition etc. I can even see problems with eclim-problems. However, when I make a syntax error, ...
2
votes
1answer
267 views

setting JDEE-server in emacs?

i've installed jdee from package-list it was elpa i think .. color highlight and indentation are working fine . but when i run any command ( JDEE commands ) i get this message : Customize ‘jdee-...
2
votes
0answers
49 views

JDEE can not detect multi file

I have two files A.java (base class) and B.java (class). The class B succeed A. In file B.java, I compiled by C-c C-v C-c, then it can not detect file A.java with error message: cannot find symbol ...
2
votes
1answer
125 views

disable on-click mail sending in java mode

using spacemacs in java mode, moving the mouse over an email address displays in the modeline the text mouse-1, C-c RET: mail this address. And if I click on it, a blank email sending form is opened ...
3
votes
4answers
98 views

How do I find the variable or lisp code controlling a face at a particular column?

For the longest time I have been ignoring a face change at column 80 in my Java code. The text switches to a pinkish color as shown below. Now it is sufficiently bothersome that I would like to ...
6
votes
3answers
4k views

Setting up Ditaa in Org-mode

I've been having trouble setting up ditaa to work in emacs, I got my copy of the ditaa jar from here And I've been trying to run this code block #+begin_src ditaa :file hello.png :exports results ...
0
votes
1answer
227 views

gud-break doesn't work with jdb

I successfully attach to my java app with emacs & gud, but gud-break doesn't work as expected: it runs only: stop at :48 if the line number is 48. So even the class name is missing and the ...
7
votes
1answer
627 views

Which class or method or function am I in?

When navigating a source file with incremental search, I often find myself jumping into some context that is taller than the window. This raises the question: "Which class am I in?". Or, if the ...
1
vote
1answer
291 views

How to have c-offset style correctly detect a Java constructor and change indentation?

Currently my team (non-Emacs users) indent java like so: public DiskThresholdDecider(Settings settings, NodeSettingsService nodeSettingsService, ...
21
votes
3answers
17k views

Suitability of Emacs as a Java development IDE

I'm making yet another attempt to convert over to Emacs. I'm a decent Vi user but have been using Eclipse for most of my development work for the past 10+ years (has it been that long). So I did some ...
3
votes
0answers
49 views

Java dependency injection

I develop Java programs in Emacs occasionally, and adding a dependency to a dependency-injected class is a common action. For example, imagine adding the dependency Qux to the following class: // ...
1
vote
1answer
1k views

Company eclim: cannot complete at point

What works I have installed emacs-eclim and have it working in my Java buffers. For example, I can invoke eclim-java-refactor-rename-symbol-at-point or eclim-java-show-documentation-for-current-...
1
vote
1answer
930 views

Debugging and setting breakpoints in Java code built with Gradle

I am using Emacs (v24.4) for writing Java applications. I have created a Java library that I am building using Gradle (v2.2) and testing with Spock Framework where I have all my test cases. I would ...
5
votes
1answer
730 views

Make emacs format Java more consistently

When I open Java files originally created and edited in Emacs, the indentation shows up correctly, as in the image below: However, when I open the same file in Sublime Text, or any other editor ...
6
votes
1answer
738 views

Simple JDEE Setup for Existing Java Project

I imagine most developers, like myself, starting out with JDEE are beginning with source code that is already written as opposed to a new empty project. What I'm asking for is a simple explanation of ...
1
vote
2answers
295 views

Writing Emacs Packages in Java

I am an okay Java programmer and have very little knowledge of Emacs lisp, but I would still like to be able to write some packages for Emacs. Is there a way or package that would allow me to write a ...
1
vote
1answer
321 views

Issues setting up Java code completion in CEDET. Cannot find semantic/db-javap

The line below is in my init file: (require 'semantic/db-javap) it is causing the following error message: Debugger entered--Lisp error: (file-error "Cannot open load file" "semantic/db-javap") ...
1
vote
1answer
791 views

How to have emacs format/indent javadoc comments correctly?

Very new to emacs. (I only started day before yesterday.) I'm writing some Java and was wondering if there's an option or something I can set up so it will indent Javadoc comments correctly. What I ...
5
votes
1answer
831 views

Which version of CEDET should be used with EMACS 24.4.1 for java development?

CEDET Version: 2.0 I have EMACS version GNU Emacs 24.4.1 (x86_64-w64-mingw32) of 2014-10-20 on KAEL which comes with CEDET version Requested File Loaded Package Version ...
3
votes
1answer
614 views

Modifying Java indentation style

I use Emacs for Android development and this has been bugging me lately. I'm trying to get the following indentation behaviour: submitBtn.setOnClickListener(new OnClickListener() { @Override ...
0
votes
1answer
526 views

Flymake: no buildfile (Makefile) found

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) ...
5
votes
1answer
229 views

Get Emacs to indent fluent builder inside argument list

So emacs's java-mode handles indenting continued method invocations at the function body level out of the box, but it doesn't seem to handle them inside of an argument list. I'd like to override this ...
4
votes
1answer
578 views

How to configure specific Java indentation?

I have the following code from Intellij's indentation: public static String[] defaultMethodBlacklist = new String[]{ "getClass", "wait", "notify", "notifyAll", ...