I'm attempting to use Visual Studio Code on CentOS 7 to run/debug an existing Hello World Java project from a third party vendor. I am relatively new to Java, so perhaps there is something obvious that I'm missing.
I've set up Visual Studio Code with the extensions described here. I have also set up Apache Maven and was able to create a new Maven Java project in Visual Studio Code which compiles and can be debugged. Now I want to take the third party vendor's Hello World sample (which doesn't use Maven) and incorporate it into the working Maven sample.
I'm able to compile and run the third party vendor's untouched Hello World app from the command line. When I build it from the command line, I need to run a build.sh
script which contains the following:
#!/bin/sh
"$JDK/bin/javac" -classpath ".:..:../../../Inc/Java/com.abbyy.FREngine.jar" \ Hello.java
When I copy and paste the original Java code into my main Java file in the Maven project, this line...
import.com.abbyy.FREngine.*;
...understandably shows a "The import com.abbyy cannot be resolved" error when trying to compile.
It appears that I need to set the classpath somewhere in my project...but I can't figure out where. Yes, there's a ".classpath" file in my project, but it's not obvious where this information should go...or if it should in that file at all.
Any suggestions?