Skip to content

Commit 5165032

Browse files
committed
see #20522 see #21005 - Allow security manager, otherwise it raises a warning in Java 17 and throws an error with Java 18+
See https://bugs.openjdk.java.net/browse/JDK-8271301 See https://bugs.openjdk.java.net/browse/JDK-8270380 git-svn-id: https://josm.openstreetmap.de/svn/trunk@18322 0c6e7542-c601-0410-84e7-c038aed88b3b
1 parent 29423e6 commit 5165032

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

build.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ Build-Date: ${build.tstamp}
457457
<jvmarg value="${jacocoagent@{testfamily}@{testITsuffix}}" if:set="jacocoagent@{testfamily}@{testITsuffix}" />
458458
<jvmarg value="-Dfile.encoding=UTF-8"/>
459459
<jvmarg value="-Djava.locale.providers=SPI,JRE,CLDR" if:set="isJava9" />
460+
<jvmarg value="-Djava.security.manager=allow" if:set="isJava17" />
460461
<jvmarg value="-javaagent:${test.dir}/lib/jmockit.jar"/>
461462
<jvmarg value="-Djunit.jupiter.extensions.autodetection.enabled=true"/>
462463
<jvmarg value="-Djunit.jupiter.execution.parallel.enabled=true"/>

src/org/openstreetmap/josm/gui/MainApplication.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,6 +1034,11 @@ private static void updateSystemProperties() {
10341034
}
10351035
// Disable automatic POST retry after 5 minutes, see #17882 / https://bugs.openjdk.java.net/browse/JDK-6382788
10361036
Utils.updateSystemProperty("sun.net.http.retryPost", "false");
1037+
if (Utils.getJavaVersion() >= 17) {
1038+
// Allow security manager, otherwise it raises a warning in Java 17 and throws an error with Java 18+
1039+
// See https://bugs.openjdk.java.net/browse/JDK-8271301 / https://bugs.openjdk.java.net/browse/JDK-8270380
1040+
Utils.updateSystemProperty("java.security.manager", "allow");
1041+
}
10371042
}
10381043

10391044
/**

0 commit comments

Comments
 (0)