DEV Community

Cover image for No Laptop? No Problem: Setting Up a Professional Kotlin & Java Environment in Termux
Bright Emmanuel
Bright Emmanuel

Posted on

No Laptop? No Problem: Setting Up a Professional Kotlin & Java Environment in Termux

A common myth in software development is that you need a $2,000 MacBook to start building professional-grade applications. While high-end hardware is nice, the most powerful tool you have is your logic—and for many of us, that logic lives on the mobile device in our pockets.
As a student currently balancing intensive exams like JUPEB and JAMB, I’ve had to find ways to keep my development skills sharp without always being tied to a desk. In this guide, I’ll show you how to turn your Android device into a professional Kotlin and Java development environment using Termux.

1. Why Termux? (And the Play Store Trap)

Before we start, we need to address a major "gotcha." If you search for Termux on the Google Play Store, you will find it—but do not install it from there.
The Why: Due to changes in Android's security API levels, the Play Store version of Termux can no longer receive updates. This leads to "repository under maintenance" errors and prevents you from installing modern packages like OpenJDK 17.
The Solution: Always download Termux from F-Droid or the official GitHub releases. This version is fully maintained and allows us to access the latest developer tools.

2. Preparing the Ground

Once you have Termux installed from F-Droid, open it up. Our first task is to ensure everything is up to date and that Termux can talk to your phone's internal storage.
Run these commands:

# Update the package lists and upgrade existing packages
pkg update && pkg upgrade
# Grant Termux access to your phone's folders (Downloads, Documents, etc.)
termux-setup-storage

Enter fullscreen mode Exit fullscreen mode

3. Installing the Engines: Java & Kotlin

Java is the backbone of the Android ecosystem, and Kotlin is the modern standard. We are going to install OpenJDK 17, which is a stable, Long-Term Support (LTS) version.

# Install OpenJDK 17
pkg install openjdk-17

# Install the Kotlin Compiler
pkg install kotlin
Enter fullscreen mode Exit fullscreen mode

To verify the installation, check the versions:

java -version
kotlinc -version
Enter fullscreen mode Exit fullscreen mode

4. Setting Up Your Editor

You can't write code without a good editor. While many prefer Vim, it has a steep learning curve. If you want something that feels like a desktop text editor (with mouse support and familiar shortcuts), I highly recommend Micro.

pkg install micro
Enter fullscreen mode Exit fullscreen mode

To create a new file, just type micro filename.kt. You can use Ctrl+S to save and Ctrl+Q to quit—just like on a PC.

5. Your First "Mobile-Made" Program

Let’s test the environment. We will create a simple Kotlin file that displays a message.

  • Create the file: micro hello.kt
  • Paste the following code:
fun main() {
    println("Greeting from my Android device!")
    println("Hardware doesn't define a developer. Logic does.")
}
Enter fullscreen mode Exit fullscreen mode
  • Save and exit (Ctrl+S, Ctrl+Q).
  • Compile the code into a runnable JAR file:
kotlinc hello.kt -include-runtime -d hello.jar
Enter fullscreen mode Exit fullscreen mode
  • Run your program:
java -jar hello.jar
Enter fullscreen mode Exit fullscreen mode

6. Pro-Tips for Mobile Devs

  • Visual Polish (Typography): For a professional experience, use a font designed for coding like JetBrains Mono or Fira Code. In the Dev.to editor, your code blocks will look great by default, but in your actual Termux terminal, a good font reduces eye strain during long sessions.
  • Keyboard: If you don't have a physical Bluetooth keyboard, install Hacker's Keyboard from the Play Store. It provides the Tab, Ctrl, and Esc keys that are missing from standard mobile keyboards.
  • Battery: Compiling code is CPU-intensive. Keep an eye on your battery levels, as Termux can drain it quickly during heavy builds.
  • Organization: Create a dedicated directory for your projects using mkdir projects to keep your home folder clean.

Conclusion

Coding on mobile isn't just a "backup plan." For many of us, it is the primary way we learn, iterate, and build. By setting up Kotlin and Java in Termux, you are proving that the only real barrier to entry in tech is curiosity.
I'm currently using this exact setup to build a JUPEB/JAMB Prep Portal to help fellow students in Nigeria succeed in their exams.
Are you building on mobile? Drop a comment below and let me know what challenges you're facing or what you're currently working on!

Top comments (1)

Collapse
 
ezekielreu6 profile image
Ezekiel

lit🫡🫡