Detect Java version
See original GitHub issueDescription:
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:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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