Skip to content

Commit 8e8c052

Browse files
Foreign API stuff should work from JDK 22 onwards (#9)
Rather than just 23 onwards
1 parent eef259a commit 8e8c052

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Fork of of the [dirs-dev/directories-jvm](https://github.com/dirs-dev/directorie
99

1010
Compared to the upstream project, this fork:
1111
* still supports JDK 8
12-
* offers to use JNI rather than shelling out to a PowerShell script to call Windows APIs with JDK < 23
12+
* offers to use JNI rather than shelling out to a PowerShell script to call Windows APIs with JDK < 22
1313
* contains a number of fixes for Windows
1414

1515
## How to use
@@ -38,7 +38,7 @@ projDirs.preferenceDir // "/Users/name/Library/Preferences/MyApp"
3838
// ...
3939
```
4040

41-
## How to use with JNI fallback on JDK < 23
41+
## How to use with JNI fallback on JDK < 22
4242

4343
### Add dependency
4444

build.sc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ object directories extends JavaModule with DirectoriesPublishModule {
5050
Seq(PathRef(T.workspace / "src/main/java"))
5151
}
5252

53-
def jdk23ClassesResources = T {
54-
val destDir = T.dest / "META-INF/versions/23"
53+
def jdk22ClassesResources = T {
54+
val destDir = T.dest / "META-INF/versions/22"
5555
os.makeDir.all(destDir)
56-
for (elem <- os.list(jdk23.compile().classes.path))
56+
for (elem <- os.list(jdk22.compile().classes.path))
5757
os.copy(elem, destDir / elem.last)
5858
PathRef(T.dest)
5959
}
6060

6161
def resources = T {
62-
T.sources(Seq(PathRef(T.workspace / "src/main/resources")) ++ Seq(jdk23ClassesResources()))
62+
T.sources(Seq(PathRef(T.workspace / "src/main/resources")) ++ Seq(jdk22ClassesResources()))
6363
}
6464
def manifest = T {
6565
super.manifest().add("Multi-Release" -> "true")
@@ -108,10 +108,10 @@ object `directories-jni` extends JavaModule with DirectoriesPublishModule {
108108
}
109109
}
110110

111-
object jdk23 extends JavaModule {
111+
object jdk22 extends JavaModule {
112112
def moduleDeps = Seq(directories)
113113
def javacOptions = super.javacOptions() ++ Seq(
114-
"--release", "23"
114+
"--release", "22"
115115
)
116116
}
117117

directories-jni/src/dev/dirs/jni/WindowsJni.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static Supplier<Windows> getJdkAwareSupplier() {
2323
if (dotIdx >= 0)
2424
javaVersion = javaVersion.substring(0, dotIdx);
2525
int jdkVersion = Integer.parseInt(javaVersion);
26-
if (jdkVersion >= 23)
26+
if (jdkVersion >= 22)
2727
return Windows.getDefaultSupplier();
2828
else
2929
return () -> new WindowsJni();

0 commit comments

Comments
 (0)