I am trying to pass multiple parameters when I start tomcat through startup.bat. I tried adding these lines at the top of startup.bat file, however they do not work.
set JAVA_OPTS="-Dapplication.home=E:\\webapp -Dfilepath=D:\\newFolder\\conf\\con.properties"
Initially I was running the application with just one parameter -Dapplication.home=E:\\webapp
which worked fine. Now I need to pass another parameter and this method fails. Please advice.
On running, I get this exception a FileNotFoundException
:
java.io.FileNotFoundException: E:\webapp -Dfilepath=D:\newFolder\conf\con.properties (The filename, directory name, or volume label syntax is incorrect)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:120)
at java.io.FileInputStream.<init>(FileInputStream.java:79)
The code is reading the entire segment as a single argument.
Set JAVA_OPTS Environment Variable We can set the heap size with JAVA_OPTS using the Set command. Run the following command to set the heap size with JAVA_OPTS . Where -Xms is the minimum heap size and -Xmx is the maximum heap size. Run the command prompt as administrator and run the command above.
JAVA_OPTS is an environment variable that you can set to pass custom settings to the Java Virtual Machine (JVM) that runs Liquibase.
JAVA_OPTS is the standard environment variable that some servers and other java apps append to the call that executes the java command. This will only last as long as the console is open. To make it more permanent you can add it to your ~/. profile or ~/.
try without quotes
set JAVA_OPTS=-Dapplication.home=E:\\webapp -Dfilepath=D:\\newFolder\\conf\\con.properties
should work
set JAVA_OPTS=%JAVA_OPTS% -Dapplication.home="E:\\webapp"
set JAVA_OPTS=%JAVA_OPTS% -Dfilepath="D:\\newFolder\\conf\\con.properties"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With