Skip to content
Snippets Groups Projects
Commit 32ba6d3c authored by Thibaut DE SAIVRE's avatar Thibaut DE SAIVRE
Browse files

finish java project config

parent 14ed441a
No related branches found
No related tags found
No related merge requests found
...@@ -7,18 +7,38 @@ Where install jdk, path to java and javac ...@@ -7,18 +7,38 @@ 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. 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). 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/). Recommended JDK for windows : https://adoptium.net/temurin/releases/?os=windows&arch=x64&package=jdk.
If you are using Linux or MacOS, you should install a JDK using your package manager (apt, brew, ...).
You can find other 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 ### Commands
How this project is configured + the commands In this template project, we have chosen the following points :
- use `src/` as the source directory (containing all java files)
- use `out/` as the output directory (containing all compiled `.class` files)
- use `src/Main.java` as the main file of the java program
TODO : for Windows in particular, because there is no default Makefile support From this configuration, you can use the following commands in the `java/` folder in order to compile and run your program.
```bash
javac -sourcepath src -d out src/Main.java # Compile
java -classpath out Main # Run
```
### Linux / MacOS - Makefile ### Linux / MacOS - Makefile
TODO : how to use the makefile For OS that support the `make` command, the [`Makefile`](./Makefile) defines some commands to compile, run and clean your project.
You can use it to personalize the project structure.
```bash
make compile # Compile the project
make run # Run the project
make clean # Clear the output directory
make # Compile, clear terminal and run
```
## VSCode Project Settings ## VSCode Project Settings
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment