Java and Kotlin
Open a Maven or Gradle project and Ferris IDEA reads its modules and dependencies, starts jdtls for Java and kotlin-language-server for Kotlin, offers build, test and framework run configurations, and debugs on the JVM with hot swap for Java. Java and Kotlin support is Works.
Before you start
Section titled “Before you start”-
A JDK. Ferris IDEA finds JDKs in
JAVA_HOME,/Library/Java/JavaVirtualMachinesand~/Library/Java/JavaVirtualMachines(macOS),/usr/lib/jvm(Linux),~/.jdks, SDKMAN, the JDKs Gradle provisioned, and thePATH. It reads the version the project asks for frompom.xml, the Gradle build,.java-version,.sdkmanrcor.idea/misc.xml. -
Maven or Gradle, or the project’s wrapper (
./mvnw,./gradlew), which is used when present. -
jdtls for Java. It needs the JDK it was built for. On Linux, use the distribution’s package or the Eclipse JDT Language Server download.
macOS brew install jdtlsThe install hint Ferris IDEA names in language_servers, version 1.6.0.
-
kotlin-language-server for Kotlin:
macOS brew install kotlin-language-server -
java-debug for debugging Java: the plugin jar
com.microsoft.java.debug.plugin-0.53.x.jarof the java-debug project in~/.local/opt/java-debug, or its path in the environment variableFERRIS_IDEA_JAVA_DEBUG. Only the 0.53 series is accepted. -
kotlin-debug-adapter for debugging Kotlin: unpack its release so that
~/.local/opt/kotlin-debug-adapter-<version>/adapter/bin/kotlin-debug-adapterexists, or put it on thePATH, or name it inFERRIS_IDEA_KOTLIN_DEBUG.
Settings › Build, Execution, Deployment › Build Tools shows which JDKs were found, which one
fits the project and why, and whether Maven and Gradle come from the project’s wrapper, the
PATH or are not installed. The page only reads.
The project model
Section titled “The project model”Ferris IDEA reads pom.xml, build.gradle and build.gradle.kts, with their modules and
dependencies. View › Tool Windows › Maven and Gradle show the modules, their tasks and the
dependency tree. A project saved by IntelliJ IDEA (.idea or .ipr) also brings its modules,
source roots, libraries and run configurations when you open it.
When the build file names Lombok, its jar from the local Maven or Gradle cache is passed to jdtls, so the generated getters and builders are known. In a project you have not trusted, Lombok is not loaded and kotlin-language-server is not started, because it runs the build.
What you get in the editor
Section titled “What you get in the editor”- Completion, smart completion, auto-import, parameter info, navigation, type and call hierarchy,
find usages and inspections from the servers, plus Ferris IDEA’s own Java and Kotlin
inspections (string or array compared with
==, ignored results, integer division, unused imports, locals, parameters and private members, emptycatch, and others). - Code › Generate… (⌘N): for Java Constructor, Getter, Setter, Getter
and Setter,
equals()andhashCode(),toString(), Override, Implement and Delegate Methods, Test… and Copyright; for Kotlin Secondary Constructor,equals()andhashCode(),toString(), Override and Implement Members. - Code › Override Methods… (⌃O), Implement Methods… (⌃I), Delegate Methods… and Surround With… (⌥⌘T; Java only).
- Code › Optimize Imports (⌃⌥O) for Java is Ferris IDEA’s own:
it removes unused imports and sorts the rest, and never collapses imports into
*. - Reformat Code (⌥⌘L) formats through the server. For Kotlin a selection is formatted as part of the whole file.
- Refactor: rename, Extract Variable, Constant, Field, Parameter and Method, and Inline, including three variants of Inline Method, for Java. Kotlin has rename and the server’s code actions, but not Ferris IDEA’s own Extract and Surround With.
- Spring, Jakarta EE, Quarkus and Micronaut: beans, configuration keys and HTTP endpoints are found in the code and listed in Search Everywhere’s Endpoints tab.
Run and test
Section titled “Run and test”The run list shows under “Detected from build files”:
| Build | Configurations |
|---|---|
| Maven | mvn compile, mvn test; Spring Boot, Quarkus dev or Micronaut run when the project uses that framework |
| Gradle | gradle build, gradle test; bootRun, quarkusDev or run for the frameworks |
Test configurations read the JUnit reports (target/surefire-reports, build/test-results/test)
into the result tree; see Run tests.
Run › Run Current File (⌃⇧R):
| Caret in | Command |
|---|---|
a Java class with main, Maven |
mvn -q compile exec:java -Dexec.mainClass=… |
a Java class with main, no build tool |
javac, then java -cp …, or java File.java for a single file |
| a test class or method, Maven | mvn test -Dtest=Class#method |
| a test class or method, Gradle | gradle test --tests pkg.Class.method |
a Kotlin main, Gradle |
gradle -q classes, then kotlin -cp build/classes/kotlin/main MainKt |
a Kotlin main, Maven |
mvn -q compile, then kotlin -cp target/classes … |
a Kotlin main, no build tool |
kotlinc … -include-runtime -d .ferris-idea/run/<name>.jar, then java -jar |
- Set a breakpoint (⌘F8). On a Java method header it becomes a method breakpoint, drawn as a diamond.
- Run › Debug Current File (⌃⇧D) on a class with
main. Java runs under java-debug inside jdtls; Kotlin under kotlin-debug-adapter. - Java gets the full set: exception breakpoints by class, field watchpoints, thread selection with states and groups, and hot swap. kotlin-debug-adapter does not evaluate conditions, hit counts and log messages itself, so Ferris IDEA evaluates them at each stop, which is slower; the debug console says so.
Hot swap (Java): save a changed Java file while the session runs. A bar shows “Code changed” with Reload Changed Classes (⌃⌥⇧F9). Details and limits: Attach and hot swap.
To debug a JVM that is already running with a JDWP port, use Attach to Process with host:port.
When it does not work
Section titled “When it does not work”- jdtls starts but finds nothing: it needs the JDK it was built for; check
Settings › Build, Execution, Deployment › Build Tools and
JAVA_HOME. - “Cannot debug Java: the java-debug plugin is not installed …”: put the 0.53 jar into
~/.local/opt/java-debug. - “Cannot debug Kotlin: kotlin-debug-adapter is missing …”: unpack its release into
~/.local/optor setFERRIS_IDEA_KOTLIN_DEBUG. - Kotlin has no code insight in a new project: kotlin-language-server is not started in safe mode; trust the project.
Shortcuts
Section titled “Shortcuts”| Action | Shortcut |
|---|---|
| Code › Generate | ⌘N or ⌃↩AltInsert |
| Code › Implement Methods | ⌃ICtrlI |
| Code › Optimize Imports | ⌃⌥OCtrlAltO |
| Code › Override Methods | ⌃OCtrlO |
| Code › Surround With | ⌥⌘TCtrlAltT |
| HotswapHotswap | ⌃⌥⇧F9CtrlAltShiftF9 |
| Navigate › Type Hierarchy | ⌃HCtrlH |
For agents
Section titled “For agents”build_projectBuild Project in one call: the window's Build Project chain (Before Build tasks, cargo, Maven, Gradle and Go builds, After Build tasks), stopping at the first failure.debug_hot_swapHot swap (Reload Changed Classes, SPEC-0091 v12): builds the changed workspace sourcesfilesfor a Java debug session (java-debug in jdtls) and reloads the changed classes into the running program; returns their names.dependency_treeDependency tree and tasks of one module, as the build tools window shows them: transitive dependencies from Cargo.lock or package-lock.json (each package expanded once, later occurrences marked repeated); for Maven and Gradle from the build tool's resolution (Gradle per classpath configuration,a → bwhere Gradle chose another version), kept until the build file changes, made now with resolve=true (needs therunright) —resolvedsays whether the tree is current; direct dependencies with locked versions otherwise; tasks with their commands.generate_choicesWhat Generate offers in the Java class around a 1-based line: for each kind that applies its fields withchecked(the default selection) and itstemplates, usable asfieldsandtemplateof generate_code.generate_codeGenerate code in the Java class around a line from its non-static fields, like the Generate menu:constructor,getters,setters,getters_and_setters,equals_hash_codeorto_string; Javatemplatepicks one of generate_choices.java_environmentJava setup of the workspace without starting a JVM: installed JDKs (JAVA_HOME, system and user JVM folders, SDKMAN, Gradle JDKs, PATH) with version, feature release, vendor, compiler and architecture from theirreleasefiles; the Java version the project states (Maven, Gradle toolchain/compatibility,.java-version,.sdkmanrc,.idea/misc.xml) with contradictions as problems; which JDK is selected and why, and whether it can build the project.optimize_importsOptimize Imports.override_methodsOverride/Implement Methods for the Java (via jdtls) or Kotlin class at a position.project_modelProject model read from the build files in the workspace (Cargo, npm, Python, Maven, Go; Gradle detected): modules with name, version, folder, toolchain, dependencies with scope, tasks and members; problems per build file; suggested run configurations (Python ones with the workspace's selected interpreter,${workspace}/…inside the workspace).
No tool matches. Try fewer words, or .