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.
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.
I compiled the code with a command like the one below:
java -g -cp .:../../deps/dep1.jar:../../deps/dep2.jar:../../deps/dep3.jar nameofclass/Nameofclass.java nameofclass/File1.java nameofclass/File2.java nameofclass/File3.java
I can then execute with jdb
as shown below:
jdb -classpath ".:../../deps/dep1.jar:../../deps/dep2.jar:../../deps/dep3.jar:" nameofclass.Nameofclass file1.ext file2.ext
Then in jdb:
run nameofclass.Nameofclass file1.ext file2.ext
When I do so, in jdb I get the print out of the process that correctly runs the code, and finishes with a The application exited
:
Set uncaught java.langh.Throwable
Set deferred uncaught java.langh.Throwable
>
VM Started: /path/to/src
<print out of the code running correctly>
The application exited
So far, so good. When I try to run the same code with java
instead of jdb
, I get:
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
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 jdb
.
Any ideas how to run the code that I can run successfully with jdb
but simply with java
on the command-line here?