Skip to content

Commit

Permalink
Remove hardcoded paths. Tweak some UI field settings for cloud.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkraljevic committed Jun 3, 2013
1 parent 709570d commit 6e6f604
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions launcher/src/H2OLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.awt.event.*;
import javax.swing.*;
import java.io.BufferedReader;
import java.io.File;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.io.IOException;
Expand Down Expand Up @@ -143,13 +144,16 @@ private void startProcess() {
}

try {
ProcessBuilder pb =
new ProcessBuilder("/Users/tomk/0xdata/H2OInstallerJRE/macosx/Contents/Resources/jre1.7.0_21-osx/java-osx/bin/java",
"-Xmx" + xmxField.getText().trim(),
"-jar", "/Users/tomk/0xdata/ws/h2o/target/h2o.jar",
"-name", cloudField.getText().trim(),
"-port", portField.getText().trim()
);
File currentDirectory = new File(new File(".").getAbsolutePath());
String javaBinary = currentDirectory.getAbsolutePath().toString() + "/jre1.7.0_21-osx/java-osx/bin/java";
String h2oJar = currentDirectory.getAbsolutePath().toString() + "/h2o.jar";
ProcessBuilder pb = new ProcessBuilder(
javaBinary,
"-Xmx" + xmxField.getText().trim(),
"-jar", h2oJar,
"-name", cloudField.getText().trim(),
"-port", portField.getText().trim()
);
pb.redirectErrorStream(true);

Process p = pb.start();
Expand Down Expand Up @@ -253,9 +257,9 @@ public H2OLauncher() {
addPadding();

JLabel cloudLabel;
cloudLabel = new JLabel ("Cloud name");
cloudLabel = new JLabel ("H2O cluster name");
cloudField = new JTextField (20);
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.");
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.");
cloudField.addActionListener(this);
cloudField.setActionCommand(CLOUD_COMMAND);
{
Expand All @@ -264,7 +268,7 @@ public H2OLauncher() {
if (randValue < 0) {
randValue = -randValue;
}
String s = "cloud_" + (randValue.toString());
String s = "h2o_cluster_" + (randValue.toString());
cloudField.setText (s);

myAdd(cloudLabel, makeLabelConstraints());
Expand Down

0 comments on commit 6e6f604

Please sign in to comment.