diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp
index 4ebf50ef0d3b6..98a98e1f36d76 100644
--- a/src/hotspot/os/linux/os_linux.cpp
+++ b/src/hotspot/os/linux/os_linux.cpp
@@ -412,7 +412,7 @@ void os::init_system_properties_values() {
   //        ...
   //        7: The default directories, normally /lib and /usr/lib.
 #ifndef OVERRIDE_LIBPATH
-  #if defined(AMD64) || (defined(_LP64) && defined(SPARC)) || defined(PPC64) || defined(S390)
+  #if defined(_LP64)
     #define DEFAULT_LIBPATH "/usr/lib64:/lib64:/lib:/usr/lib"
   #else
     #define DEFAULT_LIBPATH "/lib:/usr/lib"
diff --git a/src/java.desktop/share/classes/javax/swing/JPasswordField.java b/src/java.desktop/share/classes/javax/swing/JPasswordField.java
index a671cdf148ece..577998cb3367c 100644
--- a/src/java.desktop/share/classes/javax/swing/JPasswordField.java
+++ b/src/java.desktop/share/classes/javax/swing/JPasswordField.java
@@ -510,20 +510,19 @@ private String getEchoString(String str) {
          * @since 1.6
          */
         public String getAtIndex(int part, int index) {
-           String str = null;
             if (part == AccessibleText.CHARACTER) {
-                str = super.getAtIndex(part, index);
+                return getEchoString(super.getAtIndex(part, index));
             } else {
                 // Treat the text displayed in the JPasswordField
                 // as one word and sentence.
-                char[] password = getPassword();
-                if (password == null ||
-                    index < 0 || index >= password.length) {
+                int length = getDocument().getLength();
+                if (index < 0 || index >= length) {
                     return null;
                 }
-                str = new String(password);
+                char[] password = new char[length];
+                Arrays.fill(password, getEchoChar());
+                return new String(password);
             }
-            return getEchoString(str);
         }
 
         /**
@@ -544,8 +543,7 @@ public String getAtIndex(int part, int index) {
          */
         public String getAfterIndex(int part, int index) {
             if (part == AccessibleText.CHARACTER) {
-                String str = super.getAfterIndex(part, index);
-                return getEchoString(str);
+                return getEchoString(super.getAfterIndex(part, index));
             } else {
                 // There is no word or sentence after the text
                 // displayed in the JPasswordField.
@@ -571,8 +569,7 @@ public String getAfterIndex(int part, int index) {
          */
         public String getBeforeIndex(int part, int index) {
             if (part == AccessibleText.CHARACTER) {
-                String str = super.getBeforeIndex(part, index);
-                return getEchoString(str);
+                return getEchoString(super.getBeforeIndex(part, index));
             } else {
                 // There is no word or sentence before the text
                 // displayed in the JPasswordField.
@@ -627,14 +624,14 @@ public AccessibleTextSequence getTextSequenceAt(int part, int index) {
             } else {
                 // Treat the text displayed in the JPasswordField
                 // as one word, sentence, line and attribute run
-                char[] password = getPassword();
-                if (password == null ||
-                    index < 0 || index >= password.length) {
+                int length = getDocument().getLength();
+                if (index < 0 || index >= length) {
                     return null;
                 }
+                char[] password = new char[length];
+                Arrays.fill(password, getEchoChar());
                 String text = new String(password);
-                return new AccessibleTextSequence(0, password.length - 1,
-                                                  getEchoString(text));
+                return new AccessibleTextSequence(0, password.length - 1, text);
             }
         }
 
diff --git a/test/jdk/jdk/jfr/jcmd/TestJcmdDump.java b/test/jdk/jdk/jfr/jcmd/TestJcmdDump.java
index 3765a4935fc8e..6f4be44ff6377 100644
--- a/test/jdk/jdk/jfr/jcmd/TestJcmdDump.java
+++ b/test/jdk/jdk/jfr/jcmd/TestJcmdDump.java
@@ -33,8 +33,10 @@
 import jdk.jfr.Recording;
 import jdk.jfr.consumer.RecordedEvent;
 import jdk.jfr.consumer.RecordingFile;
+import jdk.test.lib.JDKToolFinder;
 import jdk.test.lib.jfr.EventNames;
 import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.process.ProcessTools;
 
 /**
  * @test
@@ -53,9 +55,9 @@ static class RunningEvent extends Event {
 
     private static final String[] names = { null, "r1" };
     private static final boolean booleanValues[] = { true, false };
+    private static final long timeoutMillis = 50000;
 
     public static void main(String[] args) throws Exception {
-
         // Create a stopped recording in the repository to complicate things
         Recording r = new Recording();
         r.start();
@@ -105,8 +107,10 @@ private static void jfrDump(Boolean pathToGCRoots, String name, boolean disk, Pr
             leakList.add(new Object[1000_0000]);
             System.gc(); // This will shorten time for object to be emitted.
             File recording = new File("TestJCMdDump.jfr");
-            String[] params = buildParameters(pathToGCRoots, name, recording);
-            OutputAnalyzer output = JcmdHelper.jcmd(params);
+            List<String> params = buildParameters(pathToGCRoots, name, recording);
+            System.out.println(params);
+            OutputAnalyzer output = ProcessTools.executeProcess(new ProcessBuilder(params));
+            output.reportDiagnosticSummary();
             JcmdAsserts.assertRecordingDumpedToFile(output, recording);
             int rootCount = 0;
             int oldObjectCount = 0;
@@ -155,8 +159,11 @@ private static void jfrDump(Boolean pathToGCRoots, String name, boolean disk, Pr
         }
     }
 
-    private static String[] buildParameters(Boolean pathToGCRoots, String name, File recording) {
+    private static List<String> buildParameters(Boolean pathToGCRoots, String name, File recording) {
         List<String> params = new ArrayList<>();
+        params.add(JDKToolFinder.getJDKTool("jcmd"));
+        params.add("-J-Dsun.tools.attach.attachTimeout=" + timeoutMillis);
+        params.add(String.valueOf(ProcessHandle.current().pid()));
         params.add("JFR.dump");
         params.add("filename=" + recording.getAbsolutePath());
         if (pathToGCRoots != null) { // if path-to-gc-roots is omitted, default is used (disabled).
@@ -165,6 +172,6 @@ private static String[] buildParameters(Boolean pathToGCRoots, String name, File
         if (name != null) { // if name is omitted, all recordings will be dumped
             params.add("name=" + name);
         }
-        return params.toArray(new String[0]);
+        return params;
     }
 }