mirror of
https://github.com/processing/processing4.git
synced 2026-01-27 18:31:07 +01:00
get installed JDK platform independent
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="temurin-21" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="temurin-17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -429,11 +429,17 @@ public class Platform {
|
||||
if(new File(home, "bin/java").exists()){
|
||||
return new File(home);
|
||||
}else{
|
||||
// TODO make platform independent
|
||||
// Windows: C:\Program Files\Eclipse Adoptium\jdk-17*
|
||||
// macOS/Linux: /usr/lib/jvm/, /opt/, /Library/Java/JavaVirtualMachines/
|
||||
|
||||
return new File("/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home");
|
||||
String os = System.getProperty("os.name").toLowerCase();
|
||||
// Default installation paths for different operating systems
|
||||
if (os.contains("windows")) {
|
||||
var programFiles = new File(System.getenv("ProgramFiles"));
|
||||
return new File(programFiles, "Eclipse Adoptium/jdk-17.0.10+7-hotspot");
|
||||
} else if (os.contains("mac")) {
|
||||
return new File("/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home");
|
||||
} else {
|
||||
// Linux and others
|
||||
return new File("/usr/lib/jvm/temurin-17-jdk");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Platform.isMacOS()) {
|
||||
|
||||
Reference in New Issue
Block a user