You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's a breakdown of the different project components:
6
+
7
+
*`src/main/java`: The source code for the project, organized by package:
8
+
*`eu.ammbra.bday.Organizer.java`: The main entry point of the application, possibly responsible for coordinating the overall flow of the program.
9
+
*`eu.ammbra.bday.details`: A package containing domain model classes. These classes represent entities involved in birthday celebrations, such as cakes, parties, and people attending them.
10
+
*`eu.ammbra.bday.handlers`: A package containing classes responsible for handling specific tasks.
11
+
*`eu.ammbra.bday.operations`: A package containing classes responsible for handling the operational side of parties.
12
+
*`eu.ammbra.bday.store`: A package containing classes responsible for interacting with data from files.
13
+
*`src/main/resources/store/events.json`: A resource file containing sample event data in JSON format.
14
+
*`src/test/java`: The source code for unit tests and integration tests.
15
+
16
+
## **Lab Activity No 1**: Launch Multiple Java Files
17
+
18
+
Since JDK 22 you can use the Java launcher to [execute source-code programs provided as multiple files](https://docs.oracle.com/en/java/javase/23/docs/specs/man/java.html#using-source-file-mode-to-launch-source-code-programs).
19
+
20
+
```shell
21
+
java --class-path '*' Prog1.java
22
+
```
23
+
This activity relies on you to execute the following steps:
24
+
25
+
1. Open a terminal window in the `lab-jdk-tools/A_bday_java` folder. You can use the terminal of your IDE/code editor.
26
+
2. Check that $JAVA_HOME is properly set by trying `echo $JAVA_HOME`.
27
+
3. Inside the terminal, execute the `java` command to launch `Organizer` class from `src/main/java/eu/ammbra/bday/`.
28
+
Pay attention to the following:
29
+
30
+
* classpath libraries located in `lab-jdk-tools/lib` folder.
31
+
* the project uses preview features so do not forget to enable those via `--enable-preview`
32
+
33
+
## Solution
34
+
35
+
→[Click to see the solution](SOLUTION.md#lab-activity-no-1-launch-multiple-java-files)
36
+
37
+
## **Lab Activity No 2**: Use the Java Command-Line Argument Files
38
+
39
+
When working with the `java` launcher, you can shorten or simplify the `java` command by using `@` argument files to specify one or more text files that contain arguments.
40
+
The arguments can be options and class names, which are then passed to the `java` command. [This](https://docs.oracle.com/en/java/javase/23/docs/specs/man/java.html#java-command-line-argument-files) allows you to :
41
+
42
+
* create `java` commands of any length on any operating system
43
+
* for containerized applications, easily swap the content the argument files without modifying the Dockerfile.
44
+
45
+
This activity requires you to:
46
+
47
+
1. Create a file and copy the arguments you used to launch the `Organizer` class from `src/main/java/eu/ammbra/bday/`.
48
+
2. Now launch again the `Organizer` class by providing the file as argument `java @your-arg-file-name`.
49
+
50
+
## Solution
51
+
52
+
→[Click to see the solution](SOLUTION.md#lab-activity-no-2-use-the-java-command-line-argument-files)
53
+
54
+
Next step is to [create some documentation](../B_bday_javadoc/README.md)!
0 commit comments