@@ -256,6 +256,7 @@ private static boolean containsExcludedFlags(String testStr) {
256256 * @param fileName user input archive name, can be null.
257257 */
258258 private static void dumpSharedArchive (boolean isStatic , String fileName ) throws Exception {
259+ String cwd = new File ("" ).getAbsolutePath (); // current dir used for printing message.
259260 String currentPid = String .valueOf (ProcessHandle .current ().pid ());
260261 String archiveFileName = fileName != null ? fileName :
261262 "java_pid" + currentPid + (isStatic ? "_static.jsa" : "_dynamic.jsa" );
@@ -299,8 +300,8 @@ private static void dumpSharedArchive(boolean isStatic, String fileName) throws
299300 Process proc = Runtime .getRuntime ().exec (cmds .toArray (new String [0 ]));
300301
301302 // Drain stdout/stderr to files in new threads.
302- String stdOutFile = drainOutput (proc .getInputStream (), proc .pid (), "stdout" , cmds );
303- String stdErrFile = drainOutput (proc .getErrorStream (), proc .pid (), "stderr" , cmds );
303+ String stdOutFileName = drainOutput (proc .getInputStream (), proc .pid (), "stdout" , cmds );
304+ String stdErrFileName = drainOutput (proc .getErrorStream (), proc .pid (), "stderr" , cmds );
304305
305306 proc .waitFor ();
306307 // done, delete classlist file.
@@ -311,14 +312,15 @@ private static void dumpSharedArchive(boolean isStatic, String fileName) throws
311312 if (!tempArchiveFile .exists ()) {
312313 throw new RuntimeException ("Archive file " + tempArchiveFileName +
313314 " is not created, please check stdout file " +
314- stdOutFile + " or stderr file " +
315- stdErrFile + " for more detail" );
315+ cwd + File . separator + stdOutFileName + " or stderr file " +
316+ cwd + File . separator + stdErrFileName + " for more detail" );
316317 }
317318 } else {
318319 dumpDynamicArchive (tempArchiveFileName );
319320 if (!tempArchiveFile .exists ()) {
320321 throw new RuntimeException ("Archive file " + tempArchiveFileName +
321- " is not created, please check process " +
322+ " is not created, please check current working directory " +
323+ cwd + " for process " +
322324 currentPid + " output for more detail" );
323325 }
324326 }
@@ -331,6 +333,6 @@ private static void dumpSharedArchive(boolean isStatic, String fileName) throws
331333 throw new RuntimeException ("Cannot rename temp file " + tempArchiveFileName + " to archive file" + archiveFileName );
332334 }
333335 // Everyting goes well, print out the file name.
334- System .out .println ((isStatic ? "Static" : " Dynamic" ) + " dump to file " + archiveFileName );
336+ System .out .println ((isStatic ? "Static" : " Dynamic" ) + " dump to file " + cwd + File . separator + archiveFileName );
335337 }
336338}
0 commit comments