Skip to content

Commit

Permalink
Remove support for java7.home property in the configuration file in f…
Browse files Browse the repository at this point in the history
…avor of the JAVA7_HOME environment variable.
  • Loading branch information
simonharrer committed Sep 16, 2015
1 parent 2e755d0 commit 5981cf5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 0 additions & 2 deletions config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ partner.ipAndPort=localhost:2000

downloads.dir=downloads

java7.home=C:/Program Files/Java/jdk1.7.0_25

maven.container=maven
maven.home=maven/apache-maven-3.2.1
maven.download.url=https://lspi.wiai.uni-bamberg.de/svn/betsy/apache-maven-3.2.1.zip
Expand Down
9 changes: 3 additions & 6 deletions src/main/groovy/betsy/common/config/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,14 @@ public static void setPartnerIpAndPort(String newPartnerAddress) {
public static Path getJava7Home() {
// Trying to determine JDK7 Path using SysEnv
String java7env = System.getenv("JAVA7_HOME");
Path java7home;

if (java7env == null) {
// Fallback to properties file
java7home = Paths.get(PROPERTIES.getProperty("java7.home"));
} else {
java7home = Paths.get(java7env);
throw new ConfigurationException("JAVA7_HOME is not set");
}

Path java7home = Paths.get(java7env);
if (!Files.isDirectory(java7home)) {
throw new ConfigurationException("Found [" + java7home + "] for key [java7.home] " + "Path to JAVA_HOME, but the directory does not exist!");
throw new ConfigurationException("Found [" + java7home + "] via JAVA7_HOME but the directory does not exist!");
}

return java7home;
Expand Down

0 comments on commit 5981cf5

Please sign in to comment.