"java.io.IOException: Cannot run program 'jar': ..." error

When PowerServer starts, the following error appears in the command window: "java.io.IOException: Cannot run program 'jar': CreateProcess error=2, The system cannot find the file specified".

Error in JBoss command window

Cause: PowerServer needs to call the jar command to generate the appeonmobile.war file, while the system environment variable is not correctly configured for the jar command.

Solution: modify the following system environment variables to include the correct values and then restart the server:

  • The JAVA_HOME system environment variable includes the JDK home directory, for example, C:\Program Files\Java\jdk1.8.0_60 or C:\Program Files\Java\jdk1.6.0_24.

  • The CLASSPATH system environment variable includes the JDK lib directory and the tools.jar file, for example, %JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar.

  • The Path system environment variable includes the JDK bin directory, for example, %JAVA_HOME%\bin.