title: Running java program through command-line jdb executes correctly but fails when executed as java command-line
body: <p>I am relatively unexperienced in java, so hopefully I will be able to provide enough information here for this to be relevant and useful for other people.</p>
  
  <p>I am trying to run someone else's codebase that takes two input files, prints some information to STDOUT while running the code through them and quits.</p>
  
  <p>I compiled the code with a command like the one below:</p>
  
  <pre><code>java -g -cp .:../../deps/dep1.jar:../../deps/dep2.jar:../../deps/dep3.jar nameofclass/Nameofclass.java nameofclass/File1.java nameofclass/File2.java nameofclass/File3.java
  </code></pre>
  
  <p>I can then execute with <code>jdb</code> as shown below:</p>
  
  <pre><code>jdb -classpath ".:../../deps/dep1.jar:../../deps/dep2.jar:../../deps/dep3.jar:" nameofclass.Nameofclass file1.ext file2.ext
  </code></pre>
  
  <p>Then in jdb:</p>
  
  <pre><code>run nameofclass.Nameofclass file1.ext file2.ext
  </code></pre>
  
  <p>When I do so, in jdb I get the print out of the process that correctly runs the code, and finishes with a <code>The application exited</code>:</p>
  
  <pre><code>Set uncaught java.langh.Throwable
  Set deferred uncaught java.langh.Throwable
  &gt;
  VM Started: /path/to/src
  
  &lt;print out of the code running correctly&gt;
  
  The application exited
  </code></pre>
  
  <p>So far, so good. When I try to run the same code with <code>java</code> instead of <code>jdb</code>, I get:</p>
  
  <pre><code>java -cp ".:../../deps/dep1.jar:../../deps/dep2.jar:../../deps/dep3.jar:" nameofclass.Nameofclass file1.ext file2.ext
  
  Exception in thread "main" java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: java/lang/invoke/StringConcatFactory
  </code></pre>
  
  <p>with the trace pointing to a line of code at the very beginning of the main function, which does not seem to have any issues running with <code>jdb</code>.</p>
  
  <p>Any ideas how to run the code that I can run successfully with <code>jdb</code> but simply with <code>java</code> on the command-line here?</p>