playframework / playframework/playframework

Java support for routes compiler

Open
#13,212 1 comment 1 reaction 1 assignee View on GitHub

@ihostage is already working on this.

Since Mar 20, 2025.

Dominant language
Scala
Stars
12.6k
Forks
4k
Avg merge
2d 3h
Merged PRs (30d)
29

Description

The routes compiler should not only support the generation of Scala code, but it should also support the generation of Java code. Play users should be able to choose between different target languages.

I personally see two main reasons for this feature.

The first one is to avoid the need for Play users to contact and configure the Scala compiler for their build tools.

The second one, a consequence of the first, is to open the door for users like me who want to use alternative JVM languages such as Kotlin. Usually, compilers for these languages have a good interop with the Java compiler, but they don't work well together. For example, you can't use the Play reverse router in your controllers because it leads to a circular dependency in the compilation process. You need to compile your controller (Kotlin) to compile a generated router (Scala), but you need to have an already compiled reverse router to compile controller 🤪

PS: Also, I personally believe that after implementing this feature (together with Gradle plugin), we can confidently say that Play is an absolutely Java-friendly framework without any "but" or "nuance" 😄

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.