Elite Kid Productions

Your place, your needs, your time.
 
HomePortalCalendarGalleryFAQSearchRegisterLog in

Share | 
 

 JDK Find/Configure Code

Go down 
AuthorMessage
gotoel
Admin's Bitch


Posts : 2
Reputation : 0
Join date : 2009-12-23

PostSubject: JDK Find/Configure Code   Wed Dec 23, 2009 4:29 pm

Code:
@ECHO OFF
title JDK Config by GoToEl


ECHO Looking for JDK

SET KEY_NAME=HKLM\SOFTWARE\JavaSoft\Java Development Kit
FOR /F "tokens=3" %%A IN ('REG QUERY "%KEY_NAME%" /v CurrentVersion 2^>NUL') DO SET jdkv=%%A
SET jdk=

IF DEFINED jdkv (
   FOR /F "skip=2 tokens=3,4" %%A IN ('REG QUERY "%KEY_NAME%\%jdkv%" /v JavaHome 2^>NUL') DO SET jdk=%%A %%B
) ELSE (
   FOR /F "tokens=*" %%G IN ('DIR /B "%programfiles%"') DO SET jdk=%%G
)

SET jdk=%jdk%\bin
SET javac="%jdk%\javac.exe"

IF NOT EXIST %javac% (
   javac -version 2>NUL
   IF "%ERRORLEVEL%" NEQ "0" GOTO :notfound
) ELSE (
   GOTO :setpath
)
GOTO :eof

:notfound
ECHO JDK is not installed, please download and install it from:
ECHO http://java.sun.com/javase/downloads
ECHO.
PAUSE
EXIT

:setpath
SET PATH=%jdk%;%PATH%
GOTO :eof

Save as JDKfind.bat It will set your system classes and paths to where JDK is located so you will not have to reset it all the time.

All credit to me.
Back to top Go down
 
JDK Find/Configure Code
Back to top 
Page 1 of 1
 Similar topics
-
» Where can i find this code???
» Did i find Madeleine McCann by Derek Spring
» PLEASE HELP TO FIND THE MISSING
» Tenants find mummified infant in their Texas attic
» I CAN FIND MADDIE

Permissions in this forum:You cannot reply to topics in this forum
Elite Kid Productions :: Programmers Palace-
Jump to: