Observations

A user tries to install the JOC Cockpit and gets an error when tryng to start the Windows service.

+------------------------------------------------------------------------------------------------------------------------

| Start Jetty service for JOC (JobScheduler Operations Center)
+------------------------------------------------------------------------------------------------------------------------
Le service SOS JOC (JobScheduler Operations Center) démarre.
Le service SOS JOC (JobScheduler Operations Center) n'a pas pu êté lancé

Une erreur spécifique … un service s'est produit: 5.

Vous obtiendrez une aide supplémentaire en entrant NET HELPMSG 3547.

 

The log file joc.YYYY-MM-DD.log shows the following information:

[2016-12-26 14:08:11] [info] [10424] Commons Daemon procrun (1.0.15.0 32-bit) started
[2016-12-26 14:08:11] [info] [10424] Service sos_joc name SOS JOC (JobScheduler Operations Center)
[2016-12-26 14:08:12] [info] [10424] Service 'sos_joc' installed
[2016-12-26 14:08:12] [info] [10424] Commons Daemon procrun finished
[2016-12-26 14:08:12] [info] [8708] Commons Daemon procrun (1.0.15.0 32-bit) started
[2016-12-26 14:08:12] [info] [8708] Running 'sos_joc' Service ...
[2016-12-26 14:08:12] [info] [3988] Starting service ...
[2016-12-26 14:08:13] [error] [3988] Failed to execute process
[2016-12-26 14:08:13] [error] [3988] Invalid directory name.
[2016-12-26 14:08:13] [error] [3988] ServiceStart returned 5
[2016-12-26 14:08:13] [error] [3988] Invalid directory name.
[2016-12-26 14:08:13] [info] [8708] Run service finished.

Explanations

The Windows Service tries to locate the Java Virtual Machine from a non-existing directory. This happens due to the fact that the JVM is not found from the PATH - as e.g. with the installer - but from the Windows Registry or JAVA_HOME environment variable. If the JAVA_HOME environment variable points to a non-existing directory then the above error "Invalid directory name" is raised and the Windows Service will not start.

A frequent misunderstanding is to point the JAVA_HOME to the bin directory of the JVM, e.g. JAVA_HOME=C:\Program Files\Java\jre1.8.0_111\bin when in fact it should point to the installation directory of the JDK or JRE, e.g. JAVA_HOME=C:\Program Files\Java\jre1.8.0_111.

Find the complete SourceForge discussion from the [JOC] Start services failed thread.