How to set multiple JAVA_OPTS options in startup.bat
Asked Answered
F

2

12

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.

Farina answered 24/9, 2013 at 12:49 Comment(0)
R
30

try without quotes

set JAVA_OPTS=-Dapplication.home=E:\\webapp -Dfilepath=D:\\newFolder\\conf\\con.properties

should work

Rochdale answered 24/9, 2013 at 13:2 Comment(0)
H
11

set JAVA_OPTS=%JAVA_OPTS% -Dapplication.home="E:\\webapp"

set JAVA_OPTS=%JAVA_OPTS% -Dfilepath="D:\\newFolder\\conf\\con.properties"

Hildagarde answered 24/9, 2013 at 13:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.