-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRunWindows.bat
More file actions
51 lines (44 loc) · 1.5 KB
/
RunWindows.bat
File metadata and controls
51 lines (44 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
@echo off
REM ===================================================
REM Run ERP Java Program (auto-compile + silent run)
REM ===================================================
REM Change directory to where this batch file is located
cd /d "%~dp0"
REM ===================================================
REM Compile only if newer source files exist
REM ===================================================
set SRC_DIR=src
set BIN_DIR=bin
REM Check if BIN_DIR exists; if not, create it
if not exist "%BIN_DIR%" mkdir "%BIN_DIR%"
echo Checking for changes...
for /r "%SRC_DIR%" %%f in (*.java) do (
set "SRC_FILE=%%f"
set "CLASS_FILE=%BIN_DIR%%%~pnxf"
set "CLASS_FILE=%CLASS_FILE:.java=.class%"
if not exist "%CLASS_FILE%" (
set NEEDS_COMPILE=true
) else (
for %%A in ("%%f") do for %%B in ("%CLASS_FILE%") do (
if %%~tA GTR %%~tB set NEEDS_COMPILE=true
)
)
)
if defined NEEDS_COMPILE (
echo Compiling updated Java files...
javac -cp "src;.;lib\*;lib\assets" -d bin src\edu\univ\erp\ui\login\tmp.java
if %errorlevel% neq 0 (
echo.
echo ❌ Compilation failed!
pause
exit /b %errorlevel%
)
echo ✅ Compilation successful.
) else (
echo No changes detected. Skipping compilation.
)
REM ===================================================
REM Run silently using javaw (no console window)
REM ===================================================
start "" javaw -cp "bin;lib/*;lib/assets" edu.univ.erp.ui.login.tmp
exit /b 0