This guide provides instructions on how to compile and run a Java program.
Ensure you have the following installed:
- Java Development Kit (JDK)
- A terminal or command prompt
To compile the Java program, use the following command:
javac run.javaThis will generate a run.class file in the same directory.
To run the compiled Java program, use the command:
java run- Ensure that
run.javais in the current working directory. - Do not include the
.classextension when running the program. - If your program contains a
packagedeclaration, navigate to the correct directory or use the-cpoption. - If your program requires additional libraries, include them using the
-classpath(-cp) option.
For further troubleshooting, refer to the official Java Documentation.
Battleship designs: https://www.reddit.com/r/WarshipPorn/comments/lves6j/aerial_view_of_some_treaty_battleships_from_the/