diff --git a/java/.gitignore b/java/.gitignore index 7ad426ff7cf6795c2f2aa44a8e198286af73470f..ea60e783473d9805ac57082f5a9269675144f490 100644 --- a/java/.gitignore +++ b/java/.gitignore @@ -1,2 +1,5 @@ # Ignore the output directory -out/ \ No newline at end of file +out/ + +# Just to be safe : ignore all output files +*.class \ No newline at end of file diff --git a/java/Makefile b/java/Makefile index 1e6005582d9c456bf6a1070cc64330eb21bd4b2c..ac731e608bd2e081535400261754cd284e2f64ce 100644 --- a/java/Makefile +++ b/java/Makefile @@ -1,4 +1,3 @@ - # Output and source directories SOURCE_DIR = src OUTPUT_DIR = out diff --git a/java/README.md b/java/README.md index 68146f6758d9bb4a457e9e92fd65ccfa8f7349a1..fdc1035082fa544cbf77ed1c63c6503e804675d3 100644 --- a/java/README.md +++ b/java/README.md @@ -1,2 +1,40 @@ -TODO: quel output pour java + commandes avec vscode -TODO: pour Linux VSCode avec le makefile, sinon faire à la main +# Template Java Project + +## Java environment + +Where install jdk, path to java and javac + +In order to be able to compile and run Java code, you need to install a JDK (Java Development Kit) on your computer. +A JDK contains a java compiler (`javac`) and a java interpreter (`java` - JRE = Java Runtime Environment). + +You can find JDKs at https://openjdk.org/install/ (latest JDK at https://jdk.java.net/). +If you are using Linux or MacOS, you should install a JDK using your package manager (apt, brew, ...). + +### Commands + +How this project is configured + the commands + +TODO : for Windows in particular, because there is no default Makefile support + +### Linux / MacOS - Makefile + +TODO : how to use the makefile + +## VSCode Project Settings + +Relevant settings with Java : + +- format on save + +## Formatter - Java Red Hat + +The Java extension for VSCode provides a formatter. +Using a formatter ensures that the code you and your team write is consistent. +You should always use a formatter. + +### Git + +Some common gitignores for a Java project : + +- `out/` : the compiled output. In this project we specify to the compiler that it must output its `.class` compiled files to this directory. It may not be the same for every project. +- `*.class` : just to be safe : be sure not to version output files.