title: Classpath error on Linux system, works if directory accessed from Windows
body: <p>I am building a parser in Java using JFlex and JavaCUP. I copied all the necessary jar files across from my Windows development box to a Linux box, and couldn't get it to work. The command</p>
  <pre><code>java -cp jflex.jar:java-cup-11a.jar:myparser.jar main.Parser
  </code></pre>
  <p>gave me &quot;Error: could not find or load main class main.Parser.&quot;</p>
  <p>I checked the jar files: myparser.jar definitely contains main/Parser.class, and there isn't one anywhere else. Then I tried changing the order of the jar files in the classpath:</p>
  <pre><code>java -cp myparser.jar:jflex.jar:java-cup-11a.jar main.Parser
  </code></pre>
  <p>This time, it gave me a different error:</p>
  <pre><code>Error: A JNI error has occurred, please check your installation and try again
  Exception in thread &quot;main&quot; java.lang.NoClassDefFoundError: java_cup/runtime/Scanner
  </code></pre>
  <p>Finally I used Samba to make the Linux directory accessible from the Windows box, and typed this:</p>
  <pre><code>java -cp jflex.jar;java-cup-11a.jar;myparser.jar main.Parser
  </code></pre>
  <p>This is the same as the first one except with &quot;;&quot; as separators instead of &quot;:&quot;. It worked as expected, with no errors.</p>
  <p>I thought that it might be a versioning issue (&quot;write once, run anywhere... maybe&quot;). When I do &quot;java -version&quot; my Windows machine says this:</p>
  <pre><code>java version &quot;1.8.0_291&quot;
  Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
  Java HotSpot(TM) 64-Bit Server VM (build 25.291-b10, mixed mode)
  </code></pre>
  <p>My Linux box says this:</p>
  <pre><code>java version &quot;1.8.0_251&quot;
  Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
  Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)
  </code></pre>
  <p>So I find it hard to believe it's a versioning issue.</p>
  <p>Does anyone have any idea what might be causing this?</p>