File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,9 @@ static public void init() {
105
105
"An unknown error occurred while trying to load\n " +
106
106
"platform-specific code for your machine." , e );
107
107
}
108
+
109
+ // Fix the issue where `java.home` points to the JRE instead of the JDK. processing/processing4#1163
110
+ System .setProperty ("java.home" , getJavaHome ().getAbsolutePath ());
108
111
}
109
112
110
113
@@ -389,6 +392,7 @@ static public File getContentFile(String name) {
389
392
}
390
393
391
394
static public File getJavaHome () {
395
+ // Get the build in JDK location from the Jetpack Compose resources
392
396
var resourcesDir = System .getProperty ("compose.application.resources.dir" );
393
397
if (resourcesDir != null ) {
394
398
var jdkFolder = new File (resourcesDir ,"jdk" );
@@ -397,10 +401,13 @@ static public File getJavaHome() {
397
401
}
398
402
}
399
403
404
+ // If the JDK is set in the environment, use that.
400
405
var home = System .getProperty ("java.home" );
401
406
if (home != null ){
402
407
return new File (home );
403
408
}
409
+
410
+ // Otherwise try to use the Ant embedded JDK.
404
411
if (Platform .isMacOS ()) {
405
412
//return "Contents/PlugIns/jdk1.7.0_40.jdk/Contents/Home/jre/bin/java";
406
413
File [] plugins = getContentFile ("../PlugIns" ).listFiles ((dir , name ) -> dir .isDirectory () &&
You can’t perform that action at this time.
0 commit comments