
URL: http://siwego.net/dev/compile.bat
Tired of mess in project directory after single compilation process? Just drop this batch into java/bin location and modify jdk compiler path in any simple Java IDE (like JCreator LE in its best fastest ver 2.5) to "$[JavaHome]\bin\compile.bat"
with parameters for both compiler and run application -cp output $[JavaClass]
This batch is adjusted for fast edit and run single java files, demos, examples and ad hoc computations; although for bigger projects it is also possible to configure IDE to use this bypass: just create a new Tool with command CMD.EXE
and args "$[JavaHome]\bin\compile.bat" -d output %proj%.java
for compile and second Tool to set active project with command CMD.EXE
and args setx proj <proj>
(with prompt for arguments option checked).
@echo off SET _output= SET _found= rem echo processing s1w's compile output.. call :pTrim %%G _output call :clearParams %%G goto :check dir ) SET _found=true ) ) call :makedir "%CD%\output" _output goto :eof :check dir SET _lastdir= SET _path= call :lastdir %_output% _lastdir call :path %_output% _path call :makedir %_output% _output goto :eof ) :not_dir goto :err ) call :makedir %_output%\output _output goto :eof ) :makedir ) GOTO :err :compile rem set _ "%~dp0javac" -d %_output% %_params% echo. echo processed by s1w's batch echo. ) GOTO :success :lastdir exit /b :path exit /b :clearParams path SETLOCAL EnableDelayedExpansion set _tmp=!_params:*-d=-d! call :sTrim _params EXIT /b :pTrim string out -- strips white spaces (or other characters) from the path :$source http://www.dostips.com - s1w mod SETLOCAL EnableDelayedExpansion set max=32 set _finish=true ) :loopend ( ENDLOCAL & REM RETURN VALUES ) ELSE ( ) ) EXIT /b :sTrim string -- strips white spaces from the string - s1w SETLOCAL EnableDelayedExpansion ) :loopend ( ENDLOCAL & REM RETURN VALUES ) EXIT /b :err echo. echo compilation suppressed :success EXIT /b
You need to login to post a comment.