In a former version of our application, we used the Eclipse launcher on Windows for startup. We hand the launcher an .ini
file with java properties via the --launcher.ini
property.
Now, we cannot use the launcher anymore and start the application from a .bat
file using a java -jar <file>
command. Therefore, the properties in the .ini
file have to be added to this java
command individually.
My idea is to have the .bat
script read the properties from the .ini
file and store them in a variable as list. The content of this variable is then used as part of the java
command. How to do that in a robust way?
If you start it via a *.bat script I would first check if the file exists using:
if not exist myfile.ini (
# print some error
)
and if it exist I would iterate parse each line by:
FOR /F %i IN (myfile.ini) DO @echo %i
After that I would fill an array with the values and pass it to the java invocation.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.