From a48f3851763c5aef7958ecd15d66e8ce607e6720 Mon Sep 17 00:00:00 2001 From: Marcos Lopez Gonzalez Date: Mon, 17 Sep 2018 18:13:09 +0200 Subject: [PATCH] File creation for dump changed --- core-java/src/main/java/com/baeldung/heapdump/HeapDump.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); }