Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VSCode Config
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Binet Réseau
VSCode Config
Commits
32ba6d3c
Commit
32ba6d3c
authored
1 year ago
by
Thibaut DE SAIVRE
Browse files
Options
Downloads
Patches
Plain Diff
finish java project config
parent
14ed441a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/README.md
+25
-5
25 additions, 5 deletions
java/README.md
with
25 additions
and
5 deletions
java/README.md
+
25
−
5
View file @
32ba6d3c
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment