• Finding javac.exe with Win32 command line NO ENV VARIABLES
    0 replies, posted
Hi. I have a compiler script (.bat) that I wrote for java. Using java.exe is really easy, since java always places a dummy copy of java.exe in %windir%\system32. This means that I can always type "java.exe" no matter what my paths and %cd% are. Is there a way to automatically use javac.exe in a similar fashion, without setting %path% or %java_home%. Currently my batch script has this in it, and it's getting messy: [code] SET JDKVER=0.0.0_00 if EXIST "%PFPATH%\jdk1.7.0_00" SET JDKVER=1.7.0_00 if EXIST "%PFPATH%\jdk1.7.0_01" SET JDKVER=1.7.0_01 if EXIST "%PFPATH%\jdk1.7.0_02" SET JDKVER=1.7.0_02 if EXIST "%PFPATH%\jdk1.7.0_03" SET JDKVER=1.7.0_03 if EXIST "%PFPATH%\jdk1.7.0_04" SET JDKVER=1.7.0_04 if EXIST "%PFPATH%\jdk1.7.0_05" SET JDKVER=1.7.0_05 if EXIST "%PFPATH%\jdk1.7.0_06" SET JDKVER=1.7.0_06 if EXIST "%PFPATH%\jdk1.7.0_07" SET JDKVER=1.7.0_07 if EXIST "%PFPATH%\jdk1.7.0_08" SET JDKVER=1.7.0_08 if EXIST "%PFPATH%\jdk1.7.0_09" SET JDKVER=1.7.0_09 if EXIST "%PFPATH%\jdk1.7.0_10" SET JDKVER=1.7.0_10 if EXIST "%PFPATH%\jdk1.7.0_11" SET JDKVER=1.7.0_11 if EXIST "%PFPATH%\jdk1.7.0_12" SET JDKVER=1.7.0_12 if EXIST "%PFPATH%\jdk1.7.0_13" SET JDKVER=1.7.0_13 if EXIST "%PFPATH%\jdk1.7.0_14" SET JDKVER=1.7.0_14 if EXIST "%PFPATH%\jdk1.7.0_15" SET JDKVER=1.7.0_15 if EXIST "%PFPATH%\jdk1.7.0_16" SET JDKVER=1.7.0_16 if EXIST "%PFPATH%\jdk1.7.0_17" SET JDKVER=1.7.0_17 [/code] I guess what I'm looking for is some sort of copy of javac.exe that does the same thing as the dummy java.exe. Just finds the real javac.exe and passes on the params to it.
Sorry, you need to Log In to post a reply to this thread.