问题
Am newbie to oracle coherence, trying to start coherence instance with below configuration but get this error:
java -cp COHERENCE_HOME\config;COHERENCE_HOME\lib\coherence.jar com.tangosol.net.DefaultCacheServer
Error: Could not find or load main class com.tangosol.net.DefaultCacheServer
Environment: Java 1.7.17, configured as:JAVA_HOME=JAVA_HOME=C: \Program Files\Java\jdk1.7.0_17JRE_HOME=C:\Program Files\Java\jdk1.7.0_17\jreCOHERENCE_HOME=C:\coherence-java-3.7.1.0b27797\coherence
Tried multiple options but could not get much help to resolve this.
Error: Could not find or load main class com.tangosol.net.DefaultCacheServer
回答1:
If you are using Windows, System variables are to be used as %COHERENCE_HOME%, and not COHERENCE_HOME.
i.e. Your command should look like java -cp %COHERENCE_HOME%\config;%COHERENCE_HOME%\lib\coherence.jar com.tangosol.net.DefaultCacheServer
Also please check if the com.tangosol.net.DefaultCacheServer class is on the classpath.
来源:https://stackoverflow.com/questions/15993037/coherence-error-could-not-find-or-load-main-class-com-tangosol-net-defaultcach