Open thedailycommute opened 1 month ago
To be honest this play-java-angular-seed repo is pretty much unmaintained. It was moved to the playframework organization with some other seed project's which someone else maintains. If you want to provide pull requests to update this repo, feel free to do so. IMHO all this sbt launcher scriptes in this repo should just be removed.
A few days ago I downloaded a zipped version of the play-java-angular-seed to use as guidance for an (eventual) upgrade/rewrite of a legacy Angular 2/Play 2.5 application. However, when I tried to run the version of sbt included in the distribution, I was immediately presented with the following error:
I tracked the error to the file sbt-launch-lib.bash, specifically to the get_mem_opts() function, line 92, which reads:
The problem occurs because Bash is performing a lexicographical comparison of the version strings, and (incorrectly in this case) returns "true", leading to the VM error because MaxPermSize was removed in versions of Java >= 1.8.
I humbly suggest the following changes:
Add a new function, version_compare(), to allow version strings to be correctly compared.
Replace the checkJava() function with:
I have attached a fully updated version (with a .txt extension uploading purposes) to simplify validation.
I should also add that the changes were developed with the aid of ChatGPT (because it's been several decades since I last edited a bash script :-)
sbt-launch-lib.bash.txt