I want to run this GitHub java program:
https://github.com/ss2cp/AI-TicketToRide
According to the README.md it should run with src/ttr.main/TTRMain
I am trying to start the game in linux, but I keep on getting the error:
Error: Could not find or load main class src.ttr.main.TTRMain
Caused by: java.lang.ClassNotFoundException: src.ttr.main.TTRMain
I tried
java src.ttr.main.TTRMain
java src/ttr.main/TTRMain
src/ttr.main/TTRMain
java ttr.main.TTRMain
java -jar JGame.jar
java -cp . src.ttr.main.TTRMain
java -cp . ttr.main.TTRMain
from the ~/Downloads/AI-TicketToRide-master/
folder (where the README.md and .classpath file is).
I also tried it from ~/Downloads/AI-TicketToRide-master/bin/ttr/main/
and ~/Downloads/AI-TicketToRide-master/src/ttr/main/
But no luck.
I am using Ubuntu 20.04 and openjdk 11.0.20.1 2023-08-24.
How do I start the program and from which directory? And should I set a classpath?
2
Answers
The class is in the
ttr.main
package, and namedTTRMain
. Further, there is abin
folder containing the compiled classes. So, the command you want is to specify thebin
folder on your classpath and then the fully qualified class name. Like,You can maybe use ant to compile and run your code
try installing ant and then you just write
ant compile
ant run