How to get the value after "_" in Windows batch like Java -version

sample.bat


@echo off
for /f tokens^=2-5^ delims^=.-_^" %%j in ('java -fullversion 2^>^&1') do set "javaV=%%m"

echo %javaV%
pause

point

The Java version acquisition command is treated as an error output for some reason.

Recommended Posts

How to get the value after "_" in Windows batch like Java -version
How to get the date in java
How to create your own annotation in Java and get the value
[Java] How to get the maximum value of HashMap
How to get the class name / method name running in Java
[Java] How to get the key and value stored in Map by iterative processing
[Java] How to get the current directory
How to install the legacy version [Java]
How to get the length of an audio file in java
How to increment the value of Map in one line in Java
How to get Class from Element in Java
How to get the setting value (property value) from the database in Spring Framework
How to get the absolute path of a directory running in Java
[Java] How to get the redirected final URL
[Java] How to get the authority of the folder
I want to get the value in Ruby
[Java] How to get the URL of the transition source
[Java] How to omit the private constructor in Lombok
Source used to get the redirect source URL in Java
How to lower java version
An unsupported Java version How to get rid of errors
Get the next business day after the specified date in JAVA
How to retrieve the hash value in an array in Ruby
How to derive the last day of the month in Java
How to switch Java in the OpenJDK era on Mac
How to use Java HttpClient (Get)
How to learn JAVA in 7 days
How to use classes in Java?
How to name variables in Java
How to concatenate strings in java
How to automatically operate a screen created in Java on Windows
How to output the value when there is an array in the array
How to switch Java version with direnv in terminal on Mac
How to get the id of PRIMAY KEY auto_incremented in MyBatis
How to get boolean value with jQuery in rails simple form
How to solve the unknown error when using slf4j in Java
[Java] How to convert from String to Path type and get the path
[Rails] How to reset the database in production environment (Capistrano version)
Get the result of POST in Java
How to implement date calculation in Java
How to implement Kalman filter in Java
Multilingual Locale in Java How to use Locale
[Java] How to use the File class
Java reference to understand in the figure
[Java] How to use the hasNext function
Call the Windows Notification API in Java
How to do base conversion in Java
[Java] How to use the toString () method
[Processing × Java] How to use the loop
[Java] How to set the Date time to 00:00:00
How to implement coding conventions in Java
How to embed Janus Graph in Java
[Processing × Java] How to use the class
How to pass the value to another screen
[Processing × Java] How to use the function
[Java] How to use the Calendar class
[Swift] How to pass the Label value in the selected collectionViewCell to the destination TextField
[Java] How to get the current date and time and specify the display format
How to get the current date as a string in yyyyMMdd format
[Rails] How to get the user information currently logged in with devise
[Java] How to get to the front of a specific string using the String class