Skip to content

Commit b36af18

Browse files
shahaalshahaal
authored andcommitted
Solved issue with internal java path not found
1 parent dcc157c commit b36af18

2 files changed

Lines changed: 5 additions & 18 deletions

File tree

src/config/GithubConfig.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class GithubConfig {
1818
private static final String PROXY_PATH = "config/proxyConfig.xml";
1919

2020
private static final String USR_LOCAL_APPDATA_PATH = System.getProperty("user.home") + "\\AppData\\Local\\";
21-
public static final String JAVA_PATH = System.getProperty("java.home"); //"Application.JavaPath";
21+
//public static final String JAVA_PATH = System.getProperty("java.home"); //"Application.JavaPath";
2222
public static final String REPOSITORY_NAME = "Github.RepositoryName";
2323
public static final String REPOSITORY_OWNER = "Github.RepositoryOwner";
2424
private static final String APP_FOLDER = "Application.Folder";
@@ -62,15 +62,6 @@ public String getAppPath() {
6262
return USR_LOCAL_APPDATA_PATH + getValue(APP_FOLDER);
6363
}
6464

65-
/**
66-
* get the java path from the executable file location
67-
*
68-
* @return
69-
*/
70-
public String getJavaPathDir() {
71-
return System.getProperty("user.dir") + System.getProperty("file.separator") + getValue(JAVA_PATH);
72-
}
73-
7465
public String getJarPath() {
7566
return getValue(JAR_PATH);
7667
}

src/main/AppLauncherDelegate.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,17 @@ public void launchApp() throws InterruptedException, IOException {
1818

1919
String appPath = config.getAppPath();
2020
String jarName = config.getValue(GithubConfig.JAR_PATH);
21-
String javaPath = config.getValue(GithubConfig.JAVA_PATH);
21+
//String javaPath = config.getValue(GithubConfig.JAVA_PATH);
2222

2323
System.out.println("Launching " + jarName
24-
+ " with java in " + javaPath
24+
//+ " with java in " + javaPath
2525
+ " from folder " + appPath);
2626

27-
// shahaal: this parameters set the heap size of the application and the gc to use
28-
String minHeapSize = "-Xms128m";
29-
String maxHeapSize = "-Xmx768m";
30-
3127
// uncomment and add as parameter for mac os x
3228
// String firstThread = "-XstartOnFirstThread";
3329

34-
//for Windows 32/64 bit version
35-
ProcessBuilder pb = new ProcessBuilder(javaPath, "-jar", jarName, minHeapSize, maxHeapSize);
30+
//for Windows 32/64 bit version with custom heap size
31+
ProcessBuilder pb = new ProcessBuilder("java", "-Xms128m", "-Xmx768m", "-jar", jarName);
3632

3733
//for os x 32/64 bit version
3834
//ProcessBuilder pb = new ProcessBuilder(javaPath, "-jar", jarName, heapSize, gc, firstThread);

0 commit comments

Comments
 (0)