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
517 Views Asked by user2610355 At
2
There are 2 best solutions below
Related Questions in JAVA
- Add image to JCheckBoxMenuItem
- How to access invisible Unordered List element with Selenium WebDriver using Java
- Inheritance in Java, apparent type vs actual type
- Java catch the ball Game
- Access objects variable & method by name
- GridBagLayout is displaying JTextField and JTextArea as short, vertical lines
- Perform a task each interval
- Compound classes stored in an array are not accessible in selenium java
- How to avoid concurrent access to a resource?
- Why does processing goes slower on implementing try catch block in java?
- Redirect inside java interceptor
- Push toolbar content below statusbar
- Animation in Java on top of JPanel
- JPA - How to query with a LIKE operator in combination with an AttributeConverter
- Java Assign a Value to an array cell
Related Questions in SERVICE
- Debugging Windows Services while starting
- Error in Calling some service in WCF Client
- i want to create a service that does the login functionality?
- I run an EXE program from a Windows Service but I can't see form C#?
- Android check WIFI status (disconnected or user changed WIFI)
- Having two sequential steps running within a windows service
- Approach for performing long running tasks in .NET
- android - How to get a iBecon detection state when I kill app from Background?
- Symfony2 global function in entity
- Return more that one entity in RESTful response?
- angular unit testing $scope.$on in a service not working
- Are there drawbacks to leaving a SqlConnection open long-term?
- Android control music with headset buttons in a service
- Socket in service on Android writing to server but not reading
- What does the dot mean in Symfony service names?
Related Questions in PROCRUN
- Run ActiveMQ as a 64-bit service on Windows Server 2008
- Can't deploy application as windows service from shortcut in Windows Server 2008 r2
- Jar file NOT running as windows service ( using Procrun )
- Making windows service from java class with additional libraries
- windows service access to network before logon
- apache daemon procrun- java app as windows service- failing to start in 64-bit windows 7
- Windows service installed with Procrun works in //TS mode, but doesn't start as a Windows service saying it "started and then stopped"
- Check service is running with procrun
- Configure procrun in Linux machine?
- Apache Tomcat 10.0 Silent Installation
- Java how to persist a process reference so I can run process.destroy()
- How do I setup a standalone java application to run as a service using procrun?
- apache procrun fails to start service
- Tomcat procrun installer does not work with spaces in path for catalina_home
- Java as windows service with Apache Procrun and --add-module --add-opens --add-exports
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
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.