diff --git a/core-java/src/main/java/com/baeldung/heapdump/HeapDump.java b/core-java/src/main/java/com/baeldung/heapdump/HeapDump.java index 1619bc43ae..8cce20de8d 100644 --- a/core-java/src/main/java/com/baeldung/heapdump/HeapDump.java +++ b/core-java/src/main/java/com/baeldung/heapdump/HeapDump.java @@ -3,8 +3,10 @@ package com.baeldung.heapdump; import com.sun.management.HotSpotDiagnosticMXBean; import javax.management.MBeanServer; + import java.io.IOException; import java.lang.management.ManagementFactory; +import java.nio.file.Paths; public class HeapDump { @@ -16,7 +18,7 @@ public class HeapDump { } public static void main(String[] args) throws IOException { - final String file = "/tmp/dump.hprof"; + String file = Paths.get("dump.hprof").toFile().getPath(); dumpHeap(file, true); }