Skip to content

Commit 6e6f604

Browse files
committed
Remove hardcoded paths. Tweak some UI field settings for cloud.
1 parent 709570d commit 6e6f604

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

launcher/src/H2OLauncher.java

+14-10
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.awt.event.*;
44
import javax.swing.*;
55
import java.io.BufferedReader;
6+
import java.io.File;
67
import java.io.InputStreamReader;
78
import java.net.ServerSocket;
89
import java.io.IOException;
@@ -143,13 +144,16 @@ private void startProcess() {
143144
}
144145

145146
try {
146-
ProcessBuilder pb =
147-
new ProcessBuilder("/Users/tomk/0xdata/H2OInstallerJRE/macosx/Contents/Resources/jre1.7.0_21-osx/java-osx/bin/java",
148-
"-Xmx" + xmxField.getText().trim(),
149-
"-jar", "/Users/tomk/0xdata/ws/h2o/target/h2o.jar",
150-
"-name", cloudField.getText().trim(),
151-
"-port", portField.getText().trim()
152-
);
147+
File currentDirectory = new File(new File(".").getAbsolutePath());
148+
String javaBinary = currentDirectory.getAbsolutePath().toString() + "/jre1.7.0_21-osx/java-osx/bin/java";
149+
String h2oJar = currentDirectory.getAbsolutePath().toString() + "/h2o.jar";
150+
ProcessBuilder pb = new ProcessBuilder(
151+
javaBinary,
152+
"-Xmx" + xmxField.getText().trim(),
153+
"-jar", h2oJar,
154+
"-name", cloudField.getText().trim(),
155+
"-port", portField.getText().trim()
156+
);
153157
pb.redirectErrorStream(true);
154158

155159
Process p = pb.start();
@@ -253,9 +257,9 @@ public H2OLauncher() {
253257
addPadding();
254258

255259
JLabel cloudLabel;
256-
cloudLabel = new JLabel ("Cloud name");
260+
cloudLabel = new JLabel ("H2O cluster name");
257261
cloudField = new JTextField (20);
258-
cloudField.setToolTipText("H2O nodes must have the same cloud name in order to form a cloud. By default, a random name is chosen to prevent you from accidentally joining an existing cloud.");
262+
cloudField.setToolTipText("H2O nodes must have the same cluster name in order to form a cluster. By default, a random name is chosen to prevent you from accidentally joining an existing cluster.");
259263
cloudField.addActionListener(this);
260264
cloudField.setActionCommand(CLOUD_COMMAND);
261265
{
@@ -264,7 +268,7 @@ public H2OLauncher() {
264268
if (randValue < 0) {
265269
randValue = -randValue;
266270
}
267-
String s = "cloud_" + (randValue.toString());
271+
String s = "h2o_cluster_" + (randValue.toString());
268272
cloudField.setText (s);
269273

270274
myAdd(cloudLabel, makeLabelConstraints());

0 commit comments

Comments
 (0)