Sign in to follow this  
Followers 0

2 posts in this topic

Posted

Hey,

I'm currently working on migrating versions of Java to the latest build and am currently trying to do some custom reporting back to my Inventory Server; currently on OS X I'm running a shell script which looks like this:

[CODE]
/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version 2>&1 | grep "java version" | awk '{print $3}' | sed -e "s/\"//g"

[/CODE]

This exports code which looks like this:

[attachment=325244:Screen Shot 2013-01-17 at 10.22.03.png]

So what I need is a Batch Script which will do the exact same on Windows. Any ideas?

Share this post


Link to post
Share on other sites

Posted

Just in case anybody in the future needs this:

[CODE]
@echo off
setlocal

set VERSION6="1.6.0_21"
for /f "tokens=3" %%g in ('java -version 2^>^&1 ^| findstr /i "version"') do (
set JAVAVER=%%g
)
set JAVAVER=%JAVAVER:"=%
@echo %JAVAVER%
endlocal
@exit %JAVAVER%
[/CODE]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.