@echo off
REM ############################
REM Usage: rj Hello.java
REM ############################
REM 1. split Hello, java
for /f "tokens=1,2 delims=." %%x in ("%1") do set jname=%%x & set jext=%%y
REM 2. javac Hello.java && java Hello
javac %1 && java %jname% && goto finish
REM javac %1 > NUL 2>&1 && java %jname% && goto finish
echo COMPILE ERROR
:finish
pause
|
Run .java File |