Skip to content

Commit 7a97921

Browse files
committed
samepath: java >= 11
1 parent ffd6ed6 commit 7a97921

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

+stdlib/java_api.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
a = strsplit(v, '.');
1111
if(isempty(a))
12-
api = 0;
12+
api = [];
1313
return
1414
end
1515

@@ -22,4 +22,4 @@
2222
end
2323

2424

25-
%!assert(java_api() > 0)
25+
%!assert(!isempty(java_api()))

+stdlib/samepath.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
y = e1 == 0 && e2 == 0 && ...
2929
r1.ino == r2.ino && r1.dev == r2.dev;
3030

31-
elseif stdlib.has_java()
31+
elseif stdlib.has_java() && stdlib.java_api() >= 11
3232
% https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/nio/file/Files.html#isSameFile(java.nio.file.Path,java.nio.file.Path)
33-
33+
% Java 1.8 is buggy in some corner cases, so we require at least 11.
3434
y = java.nio.file.Files.isSameFile(javaPathObject(path1), javaPathObject(path2));
3535

3636
else

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@ jobs:
5656
- name: Check CodeIssues
5757
uses: ./.github/workflows/composite-check
5858

59+
# https://www.mathworks.com/support/requirements/openjdk.html
60+
# old matlab may segfault with too-new JDK
5961
- name: matlab_jenv JDK 11
60-
if: ${{ matrix.release < 'R2025a' && !startsWith(matrix.release, 'latest') }}
62+
if: ${{ matrix.release >= 'R2023a' && matrix.release < 'R2025a' && !startsWith(matrix.release, 'latest') }}
6163
run: matlab_jenv ${JAVA_HOME_11_X64}
6264

6365
- name: Matlab tell Java Version

0 commit comments

Comments
 (0)