Main improvements:
Script installer.sh:
- Removed all
chmod 777(dangerous for security) - Added
set -eto stop execution in case of errors - Removed redundant installation of Oracle Java
- Automated EULA acceptance instead of opening nano
- Removed unnecessary comments
- Simplified logic and made flow more linear
Script start.sh:
- Improved detection of the current directory
- Added logic to use the downloaded JDK 17 if available
- Changed the initial memory allocation from 2GB to 1GB (more efficient)
- Added the
noguiparameter to avoid problems in headless environments - Replaced
java -o truewithnogui(correct syntax)
Advantages of the improved version:
- More secure (no chmod 777)
- More robust (error handling)
- More automated (no manual intervention for EULA)
- More efficient (memory and performance)
- Cleaner and more maintainable code