mirror of
https://github.com/xiaozhou233/JuiceAgent.git
synced 2026-12-05 13:05:53 +08:00
Test: add java-loop demo with build and run scripts, ignore class artifacts
This commit is contained in:
1 parent
841c0e5c2f
commit
6479966472
4 files changed
+44
No files matched your search
@@ -0,0 +1,2 @@
|
||||
*.class
|
||||
build/
|
||||
@@ -0,0 +1,14 @@
|
||||
@echo off
|
||||
setlocal
|
||||
cd /d "%~dp0"
|
||||
|
||||
if not exist build mkdir build
|
||||
|
||||
javac -d build loop.java
|
||||
if errorlevel 1 (
|
||||
echo [ERROR] Build failed.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo [OK] Build succeeded: build\loop.class
|
||||
endlocal
|
||||
@@ -0,0 +1,12 @@
|
||||
public class loop {
|
||||
public static void main(String[] args) {
|
||||
while (true) {
|
||||
try {
|
||||
System.out.println("Hello, World!");
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
@echo off
|
||||
setlocal
|
||||
cd /d "%~dp0"
|
||||
|
||||
if not exist build\loop.class (
|
||||
echo [ERROR] Build output not found. Run build.bat first.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
java -cp build loop
|
||||
if errorlevel 1 (
|
||||
echo [ERROR] Run failed.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
endlocal
|
||||
Reference in new issue
Block a user