I have a java class with a main method . I converted it into a windows service using Java Service Wrapper from tanuki software . I then tried to start the service programmatically from another java program by using ProcessBuilder.
ProcessBuilder processBuilder = new ProcessBuilder("cmd.exe", "/c", "sc", "start", serviceName,mainMethodArgument);
Process process=processBuilder.start();
The service is getting started alright . But the command line argument that i passed ( mainMethodArgument ) is not getting to the service main method . What am i doing wrong? I need to send only a single startup parameter. But still it is not getting through