Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NETBEANS-4779] Update to the mac os installer as it was failing on Big Sur #2353

Merged
merged 2 commits into from Sep 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -23,7 +23,7 @@ if [ -z "$jdkhome" ] ; then

# read Java Preferences
if [ -x "/usr/libexec/java_home" ]; then
jdkhome=`/usr/libexec/java_home --version 1.8+`
jdkhome=`/usr/libexec/java_home`
fi

# JRE
Expand Down
Expand Up @@ -32,7 +32,7 @@ jdk_home=`"$dirname"/get_current_jdk.sh`

#"$dirname"/add_tc.sh "$NETBEANS_INSTALL_DIR" "$TOMCAT_INSTALL_DIR"

DEFAULT_JDK_HOME=`/usr/libexec/java_home --version 1.8+`
DEFAULT_JDK_HOME=`/usr/libexec/java_home`

if [ -f "$dirname"/set_jdk_home.sh ]; then
"$dirname"/set_jdk_home.sh "$NETBEANS_INSTALL_DIR" "$DEFAULT_JDK_HOME"
Expand Down
17 changes: 4 additions & 13 deletions nbbuild/installer/mac/newbuild/dmg/distribution-nbide.dist
Expand Up @@ -62,32 +62,23 @@ function checkMemsize() {
function checkJavaVersion() {
var JDK_ENABLED = false;
var result = false;
var java8_or_newer = false;
var jdkFound = false;
var jreFound = false;
try {
if(system.files.fileExistsAtPath('/usr/libexec/java_home')) {
var res = system.run("/usr/libexec/java_home", "--version", "1.8+", "--failfast");
java8_or_newer = (0 == res);
if(!java8_or_newer) {
var res = system.run("/usr/libexec/java_home", "--version", "1.5", "--failfast");
jdkFound = (0 == res);
}
var res = system.run("/usr/libexec/java_home", "--failfast");
jdkFound = (0 == res);
}
} catch (e) {}

if(system.files.fileExistsAtPath('/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home')) {
jreFound = true;
}

if (java8_or_newer || JDK_ENABLED && jreFound) {
if (jdkFound || JDK_ENABLED && jreFound) {
result = true;
} else {
if (jdkFound) {
my.result.type = 'Fatal';
my.result.title = system.localizedStringWithFormat('ERR_OLDER_JAVA8_TITLE');
my.result.message = system.localizedStringWithFormat('ERR_OLDER_JAVA8_TITLE');
} else if (jreFound) {
if (jreFound) {
my.result.type = 'Fatal';
my.result.title = system.localizedStringWithFormat('ERR_NO_JDK_TITLE');
my.result.message = system.localizedStringWithFormat('ERR_NO_JDK_MSG');
Expand Down
17 changes: 4 additions & 13 deletions nbbuild/installer/mac/newbuild/dmg/distribution.dist
Expand Up @@ -62,32 +62,23 @@ function checkMemsize() {
function checkJavaVersion() {
var JDK_ENABLED = false;
var result = false;
var java8_or_newer = false;
var jdkFound = false;
var jreFound = false;
try {
if(system.files.fileExistsAtPath('/usr/libexec/java_home')) {
var res = system.run("/usr/libexec/java_home", "--version", "1.8+", "--failfast");
java8_or_newer = (0 == res);
if(!java8_or_newer) {
var res = system.run("/usr/libexec/java_home", "--version", "1.5", "--failfast");
jdkFound = (0 == res);
}
var res = system.run("/usr/libexec/java_home", "--failfast");
jdkFound = (0 == res);
}
} catch (e) {}

if(system.files.fileExistsAtPath('/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home')) {
jreFound = true;
}

if (java8_or_newer || JDK_ENABLED && jreFound) {
if (jdkFound || JDK_ENABLED && jreFound) {
result = true;
} else {
if (jdkFound) {
my.result.type = 'Fatal';
my.result.title = system.localizedStringWithFormat('ERR_OLDER_JAVA8_TITLE');
my.result.message = system.localizedStringWithFormat('ERR_OLDER_JAVA8_TITLE');
} else if (jreFound) {
if (jreFound) {
my.result.type = 'Fatal';
my.result.title = system.localizedStringWithFormat('ERR_NO_JDK_TITLE');
my.result.message = system.localizedStringWithFormat('ERR_NO_JDK_MSG');
Expand Down
2 changes: 1 addition & 1 deletion nbi/engine/native/launcher/unix/src/launcher.sh
Expand Up @@ -955,7 +955,7 @@ installBundledJVMs() {

searchJavaOnMacOs() {
if [ -x "/usr/libexec/java_home" ]; then
javaOnMacHome=`/usr/libexec/java_home --version 1.8+ --failfast`
javaOnMacHome=`/usr/libexec/java_home --failfast`
fi

if [ ! -x "$javaOnMacHome/bin/java" -a -f "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" ] ; then
Expand Down