Skip to content

Commit

Permalink
Removed hardcoded JDK
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefterv committed Jan 9, 2025
1 parent a5985c3 commit 94dee41
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions app/src/processing/app/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -405,22 +405,8 @@ static public File getJavaHome() {
}

var home = System.getProperty("java.home");
if(home != null){
if(new File(home, "bin/java").exists()){
return new File(home);
}else{
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(home != null && new File(home, "bin/java").exists()){
return new File(home);
}
if (Platform.isMacOS()) {
//return "Contents/PlugIns/jdk1.7.0_40.jdk/Contents/Home/jre/bin/java";
Expand Down

0 comments on commit 94dee41

Please sign in to comment.