question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Detect Java version

See original GitHub issue

Description: Having a way of detecting a necessary Java version from the repo would be very handy, instead of needing to supply it. Many other setup-* Github actions support this. Perhaps this can be parsed from maven.compiler.target in Maven repos

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
brunoborgescommented, Sep 4, 2022

There are so many ways for the Java version to be set in a Java project, that it really should be the developer responsibility to get that information, and pass it to the action.

Here’s how I do it:

https://github.com/brunoborges/aks-jvm-benchmark/blob/main/.github/workflows/maven.yml#L19-L27

I particularly see no good reason (only cons) for implementing any further on this.

3reactions
danielcomptoncommented, Sep 4, 2022

Another source for the Java version is the .java-version file, used by jenv, as well as asdf’s .tool-versions.

Perhaps instead of automatically detecting the version and handling conflicts from different tools, you could allow setting the version from the file. For example

with:
  java-version: ‘.java-version’
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Check Which Java Version You Have in Windows 10
How to check which Java version you have in Windows 10. 1. Type "Command Prompt" into the search bar next to your Start...
Read more >
How to Check Your Java Verison in Windows & Mac
You can also check your Java version in Windows using the command line. First, click on the magnifying glass and type “cmd”, then...
Read more >
Different Ways To Check Java Version In Windows
User needs to open Command Prompt and enter- 'java -version' · Open control panel and lookup for Java · Directories method- Click the...
Read more >
How to Check Your Java Version on Windows 10
If you don't see About Java in the Start menu, search for “Configure Java” instead and click it. Then click “About” to see...
Read more >
How to Check Java Version on Mac or Windows - phoenixNAP
3. A new window with the command prompt should appear. In it, type the command java -version and hit Enter. The output should...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found