Thanks guys for the hints!! I really appreciate it!!
I think I found the problem.
java -version
java version "1.8.0_421"
Java(TM) SE Runtime Environment (build 1.8.0_421-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.421-b09, mixed mode)
which java
/usr/bin/java
file /usr/bin/java
/usr/bin/java: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e]
/usr/bin/java (for architecture x86_64): Mach-O 64-bit executable x86_64
/usr/bin/java (for architecture arm64e): Mach-O 64-bit executable arm64e
.jxec.txt points to /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java
When I run bash -vx mfc-edit.sh 2>&1 | tee /tmp/mfc-edit.txt
interesting errors appears: It seems like the path to Java contains a empty space between Internet and Plug-Ins that offends Mfc-Edit.
In .jexec.txt I've tried both
/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java
and
"/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java"
but no none works.... they get deleted.
newerJava # Has a Java update been installed ?
- newerJava
- '[' '!' -f /usr/bin/java ']'
- jbin=/usr/bin/java
/bin/ls -Ll "$jbin" | awk '{ print $5 }'
++ /bin/ls -Ll /usr/bin/java
++ awk '{ print $5 }'
- jsize=135616
- '[' 135616 -lt 1000 ']'
getJavaMinVer "$jbin"
++ getJavaMinVer /usr/bin/java
${1} -version 2>&1 | head -1 | cut -d. -f2
+++ /usr/bin/java -version
+++ head -1
+++ cut -d. -f2
++ minver=8
++ echo 8
+ bin_ver=8
getJavaBuild "$jbin"
++ getJavaBuild /usr/bin/java
${1} -version 2>&1 | head -1 | cut -d_ -f2 | cut -d\" -f1
+++ /usr/bin/java -version
+++ head -1
+++ cut -d_ -f2
+++ cut '-d"' -f1
++ bld=421
++ echo 421
- bin_bld=421
- '[' 8 = 'java version ' -o 421 = 'java version ' ']'
- '[' -f /Users/torbjornnaslund/.jexec.txt ']'
cat ~/.jexec.txt
++ cat /Users/torbjornnaslund/.jexec.txt
+ jp='/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java'
getJavaMinVer "$jp"
++ getJavaMinVer '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java'
${1} -version 2>&1 | head -1 | cut -d. -f2
+++ /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version
+++ head -1
+++ cut -d. -f2
++ minver='sh: line 475: /Library/Internet: No such file or directory'
++ echo 'sh: line 475: /Library/Internet: No such file or directory'
+ curr_ver='sh: line 475: /Library/Internet: No such file or directory'
getJavaBuild "$jp"
++ getJavaBuild '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java'
${1} -version 2>&1 | head -1 | cut -d_ -f2 | cut -d\" -f1
+++ /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version
+++ head -1
+++ cut -d_ -f2
+++ cut '-d"' -f1
++ bld='mfc-edit.sh: line 470: /Library/Internet: No such file or directory'
++ echo 'mfc-edit.sh: line 470: /Library/Internet: No such file or directory'
- curr_bld='mfc-edit.sh: line 470: /Library/Internet: No such file or directory'
- '[' 'sh: line 475: /Library/Internet: No such file or directory' -lt 8 ']'
mfc-edit.sh: line 511: [: sh: line 475: /Library/Internet: No such file or directory: integer expression expected
+ '[' 421 -gt mfc-edit.sh: line 470: /Library/Internet: No such file or directory ']'
mfc-edit.sh: line 516: [: mfc-edit.sh:: integer expression expected
So I made a symbolic link and updated .jexec with the new path
sudo ln -s /Library/Internet\ Plug-Ins /Library/Internet-Plug-Ins
but that exits with: Java execution EXIT STATUS = 1
When I run bash -vx mfc-edit.sh 2>&1 | tee /tmp/mfc-edit.txt:
newerJava # Has a Java update been installed ?
- newerJava
- '[' '!' -f /usr/bin/java ']'
- jbin=/usr/bin/java
/bin/ls -Ll "$jbin" | awk '{ print $5 }'
++ /bin/ls -Ll /usr/bin/java
++ awk '{ print $5 }'
- jsize=135616
- '[' 135616 -lt 1000 ']'
getJavaMinVer "$jbin"
++ getJavaMinVer /usr/bin/java
${1} -version 2>&1 | head -1 | cut -d. -f2
+++ /usr/bin/java -version
+++ head -1
+++ cut -d. -f2
++ minver=8
++ echo 8
+ bin_ver=8
getJavaBuild "$jbin"
++ getJavaBuild /usr/bin/java
${1} -version 2>&1 | head -1 | cut -d_ -f2 | cut -d\" -f1
+++ /usr/bin/java -version
+++ head -1
+++ cut -d_ -f2
+++ cut '-d"' -f1
++ bld=421
++ echo 421
- bin_bld=421
- '[' 8 = 'java version ' -o 421 = 'java version ' ']'
- '[' -f /Users/torbjornnaslund/.jexec.txt ']'
cat ~/.jexec.txt
++ cat /Users/torbjornnaslund/.jexec.txt
+ jp=/Library/Internet-Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java
getJavaMinVer "$jp"
++ getJavaMinVer /Library/Internet-Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java
${1} -version 2>&1 | head -1 | cut -d. -f2
+++ /Library/Internet-Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version
+++ head -1
+++ cut -d. -f2
++ minver=8
++ echo 8
+ curr_ver=8
getJavaBuild "$jp"
++ getJavaBuild /Library/Internet-Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java
${1} -version 2>&1 | head -1 | cut -d_ -f2 | cut -d\" -f1
+++ /Library/Internet-Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version
+++ head -1
+++ cut -d_ -f2
+++ cut '-d"' -f1
++ bld=421
++ echo 421
- curr_bld=421
- '[' 8 -lt 8 ']'
- '[' 421 -gt 421 ']'
I suspect there is the cut thingy that is the culprit, but I really don't know!