I'm using apache commons deamon to make a windows service. Making a simple service from a java class that has no libraries included works just fine. But my purpose is to make service from java class with multiple included jar libraries. I tried two things to make it but with no success. The first thing did was making --classpath (pathToClassFile);(pathToJarLibraries)/*jar ; This caused NoClassDefFoundException The second thing I did was making a runnable jar ( which includes all the libraries as executables). Running it in command prompt with java -jar (pathToJar) was ok but making it as a service leads again to NoClassDefFoundException. Could anyone tell me how to tell the prunsrv command that I have some jar libraries needed to run the main class file ?
Making windows service from java class with additional libraries
474 views Asked by user2610355 At
2
Looks like the syntax for classpath in prunsrv is like so:
%CLASSPATH%
is a Windows environment variable, of course, so leave it out if you don't have that environment variable.Taken from the documentation.