Skip to content

Commit

Permalink
Merge pull request #43517 from big-cir
Browse files Browse the repository at this point in the history
* pr/43517:
  Polish "Remove "java.home" system property when running in a native image"
  Remove "java.home" system property when running in a native image

Closes gh-43517
  • Loading branch information
mhalbritter committed Jan 24, 2025
2 parents d735027 + 7c6dbbf commit c9df9aa
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

import org.springframework.core.NativeDetector;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;

Expand Down Expand Up @@ -145,7 +146,9 @@ private byte[] generateHash(Class<?> sourceClass) {
update(digest, home.getSource());
update(digest, home.getDir());
update(digest, System.getProperty("user.dir"));
update(digest, System.getProperty("java.home"));
if (!NativeDetector.inNativeImage()) {
update(digest, System.getProperty("java.home"));
}
update(digest, System.getProperty("java.class.path"));
update(digest, System.getProperty("sun.java.command"));
update(digest, System.getProperty("sun.boot.class.path"));
Expand Down

0 comments on commit c9df9aa

Please sign in to comment.