hyphanet / java_installer

The java-based installer
https://freenetproject.org/
25 stars 19 forks source link

Fix for run.sh JAVA_HOME detection on Mac #8

Closed steveatinfincia closed 9 years ago

steveatinfincia commented 9 years ago

On OS X, the JAVA_HOME path detection in run.sh fails during installation and afterward with this error:

/Applications/Freenet/run.sh: line 85: test: /Library/Internet: binary operator expected

This is probably a fatal error for anyone with just Oracle JRE7/8 installed, as the fallback method for finding JAVA_HOME on OS X when this test fails (running /usr/libexec/java_home) doesn't seem to work unless Apple Java 6 or Oracle JDK7/8 are installed

steveatinfincia commented 9 years ago

Sigh... I was wrong about this being a fatal error for JRE users (at least recent ones), having that test fail just causes it to do nothing. But as it turns out, that syntax error actually prevented what would have been a bug for JRE users, it would have caused the script to run java_home for all of them, which would have failed without Oracle's JDK or Apple Java 6 installed. The fallback works as intended now though.