API to Get the apache tomcat bin path?

A

ArunDhaJ

Hi Friends,
Is there any API to get the apache tomcat installed folder. for eg:
I've to get as "D:\apache-tomcat-6.0.14\bin"....


Actually during development I ran tomcat using "startup.bat"..... and
was using System.getProperty("user.dir"); API to get the path....

But now I want the Tomcat to run as service so using "service.bat" to
intall tomcat as service... but the above API gives me "C:\Windows
\system32\"... which causes me problem...


please help me in either of the solution:
1. Is there any command to set the path in "service.bat" as the tomcat
directory so that the I can overcome the problem without any code
change.
2. Is there any other property like "user.dir" to fetch the tomcat
installed directory..


Regards,
ArunDhaJ
 
A

Arne Vajhøj

ArunDhaJ said:
Is there any API to get the apache tomcat installed folder. for eg:
I've to get as "D:\apache-tomcat-6.0.14\bin"....

Actually during development I ran tomcat using "startup.bat"..... and
was using System.getProperty("user.dir"); API to get the path....

But now I want the Tomcat to run as service so using "service.bat" to
intall tomcat as service... but the above API gives me "C:\Windows
\system32\"... which causes me problem...

please help me in either of the solution:
1. Is there any command to set the path in "service.bat" as the tomcat
directory so that the I can overcome the problem without any code
change.
2. Is there any other property like "user.dir" to fetch the tomcat
installed directory..

You can try:

System.getenv("CATALINA_HOME")

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top