Skip to content

Improve error message for unsupported Java versions (replace stack trace with a user-friendly message) #940

@joonseolee

Description

@joonseolee

Is your feature request related to a problem? Please describe.

Currently, if the user runs crowdin-cli with an unsupported Java version (e.g. Java 8),
the CLI fails with a raw UnsupportedClassVersionError and a full stack trace like this:

~ brew install crowdin
~ crowdin 
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/crowdin/cli/Cli has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0
...

Describe the solution you'd like

While this is technically accurate, it's not user-friendly — especially for less experienced developers.
It would be much more helpful if the CLI could detect the Java version early and show a clean message like:

Crowdin CLI requires Java 17 or higher. Detected version: 1.8.0_362
Please update your Java Runtime Environment.

Describe alternatives you've considered

Additional context

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions