Skip to content

Commit 612cb7c

Browse files
authored
1 parent 7a3e3e7 commit 612cb7c

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

core-java-modules/core-java-lang/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@
2828

2929
<build>
3030
<finalName>core-java-lang</finalName>
31+
<plugins>
32+
<plugin>
33+
<groupId>org.apache.maven.plugins</groupId>
34+
<artifactId>maven-compiler-plugin</artifactId>
35+
<configuration>
36+
<source>21</source>
37+
<target>21</target>
38+
</configuration>
39+
</plugin>
40+
</plugins>
3141
<resources>
3242
<resource>
3343
<directory>src/main/resources</directory>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.baeldung.commandlinearguments;
2+
3+
import java.io.IOException;
4+
import java.nio.file.Files;
5+
import java.nio.file.Path;
6+
import java.util.List;
7+
8+
public class CliFileReader {
9+
10+
public static void main(String[] args) throws IOException {
11+
if (args.length == 0) {
12+
System.out.println("Usage: CliFileReader <file-path>");
13+
}
14+
String path = args[0];
15+
List<String> lines = Files.readAllLines(Path.of(path));
16+
for (String line : lines) {
17+
System.out.println(line);
18+
19+
}
20+
21+
}
22+
23+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Hello World!
2+
Cheers
3+
Baeldung Team

0 commit comments

Comments
 (0)