From 14ed441a2662f5699c69e3cc2540f13dfe4a7bd1 Mon Sep 17 00:00:00 2001 From: Thibaut de Saivre <thibaut.de-saivre@polytechnique.edu> Date: Tue, 17 Oct 2023 15:18:29 +0200 Subject: [PATCH] prepare readme for Java --- java/.gitignore | 5 ++++- java/Makefile | 1 - java/README.md | 42 ++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 44 insertions(+), 4 deletions(-) diff --git a/java/.gitignore b/java/.gitignore index 7ad426f..ea60e78 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 1e60055..ac731e6 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 68146f6..fdc1035 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. -- GitLab