title: Error: could not find or load main class (another one)
body: <p>I've searched throughout this site and tried a few solutions when receiving this message but nothing seems to work.</p>
  
  <p>I am trying to invoke a shell script on Ubuntu 12.04.2 (with java-7-openjdk-amd64) that runs a java program and then I get a "Error: Could not find or load main class com.xx" error.</p>
  
  <p>This is how my script invokes Java:</p>
  
  <pre><code>"$JAVA" $server_jvmargs $javaProps -Dxx.home="$XX_HOME" -Duser.dir="$XX_HOME" -cp $client_classpath $mainclass $args
  </code></pre>
  
  <p>And the arguments you see above are defined as follows:</p>
  
  <pre><code>args=$*
  javaProps=
  mainclass=com.xx
  server_jvmargs="-Djava.awt.headless=true -Xms1024m -Xmx1024m $jvmargs"
  XX_HOME="`pwd`/../.."
  client_classpath="$XX_HOME/lib/client/patch.jar;$XX_HOME/lib/client/xyx-xxx.jar;$clientlibs;$XX_HOME/lib/server/standard-1.1.2.jar;$publictilesource;$respath;$XX_HOME/lib/client/xxmainclass.jar"
  </code></pre>
  
  <p>The mainclass variable is in the classpath located in the xxmainclass.jar file so I'm not sure as to why it cannot find it?</p>
  
  <p>Does anyone have any ideas on what could be going on?</p>