diannelopez
Posts: 1
Joined: Fri May 12, 2006 9:16 pm

Java Service - ini files

Can a Java service read parameters from a regular ini file? I have an application that can be run manually or as a service. The program reads and writes to an ini file but I do not know how to do it through a service because it does no find the file. The ini files is in the same folder as the executable program.

Thanks.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

You should set the working directory for the application by setting the "user.dir" property to the [APPDIR] property. You can do this by adding a new JVM parameter from "Virtual Machine" tab in the "Java Products" page like this:
Name=user.dir
Value=[APPDIR].

The user.dir property is used by Java to resolve the path of the application when running as a service.

Regards,
Gigi
_________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”