From fb41c4222778536d53f01bba9c9ff66eb06686a9 Mon Sep 17 00:00:00 2001 From: Kamal Wickramanayake Date: Mon, 16 Feb 2026 07:28:53 +0530 Subject: Added more details to create Windows batch files --- java/07-simple-objects-better-use-jar/README | 50 ++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 java/07-simple-objects-better-use-jar/README (limited to 'java/07-simple-objects-better-use-jar/README') diff --git a/java/07-simple-objects-better-use-jar/README b/java/07-simple-objects-better-use-jar/README new file mode 100644 index 0000000..f167665 --- /dev/null +++ b/java/07-simple-objects-better-use-jar/README @@ -0,0 +1,50 @@ +Commands to be executed are put in run.sh files in the two directories. + +On Linux, you can execute them as follows: + + cd myaccountslib + ./run.sh + + cd ../myapp + ./run.sh + +#### Exercise for Windows users #### + +Jump to myaccountslib directory. + +Copy the content of run.sh and save in a file called run.bat. + +Modify run.bat with commands that can be executed in a Command Prompt to +accomplish the same operations found in run.sh. Look at the NOTES section below +for assistance. + +Run the batch file (run.bat) as follows: + + .\run.bat + +Do the same for the run.sh file found inside the myapp directory. + +So on Windows, the commands may be executed as follows: + + cd myaccountslib + .\run.bat + + cd ..\myapp + .\run.bat + + +NOTES: + +While coming up with run.bat files on Windows, + + 1. The initial '#!/bin/bash' line is not needed. + + 2. Instead of '#' character to comment lines of text, use '@REM' without quotes. + + 3. To delete a directory with content inside, you can use the rmdir command like this: + rmdir /s /q "Path\to\directory" + + 4. Windows uses '\' as the directory seperator instead of '/' in Linux. + + 5. Windows uses ';' as the path seperator instead of ':' in Linux. + -- cgit v1.2.3