Re: Possible to install jEdit on a new Mac?

Vampire <[email protected]> Fri, 17 Nov 2023 13:51:33 +0100
Newsgroups gmane.editors.jedit.user
Message-ID <CAKChYSomh3L8oLwRayPAC0XLN+Zbcd6FLvO5bmqxiGUSRP42oA@mail.gmail.com>
--===============2394865353210312922==
Content-Type: multipart/alternative; boundary="0000000000004204ce060a58997d"

--0000000000004204ce060a58997d
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Yeah, the issue with the naming scheme is reported at
https://github.com/TheInfiniteKind/appbundler/issues/55.
But when no matching version is found and as no `-F` is used, it should
then return a default and that should hopefully be 21 for you.
If that is the Java 8 one for you, it will then fail for the major version
comparison.
But if it returns the Java 21 one, it should usually work.

What are these four commands returning?

/usr/libexec/java_home -v 1.11+

jEdit.app/Contents/MacOS/jedit --verbose

echo $JAVA_ARCH

find $(/usr/libexec/java_home -V 2>&1 | grep Contents/Home | rev | cut -d '
' -f 1 | rev | sort -u) -type f -name libjli.dylib


Cheers
Bj=C3=B6rn


Am Fr., 17. Nov. 2023 um 12:16 Uhr schrieb Gregory Garretson <
[email protected]>:

> Hi Bj=C3=B6rn,
>
> Thanks for this. Unfortunately, the new macOS launcher encounters the sam=
e
> problem as the one for 5.6. I get the error message that Java 11 is
> required, and I should update Java. Now, without having dug very deep int=
o
> the C code, I can see two possible reasons for this.
>
> The first is that it stops when it encounters the Java internet plugin,
> which in my case is 1.8:
>
> /usr/libexec/java_home -V
> Matching Java Virtual Machines (3):
>     21.0.1 (arm64) "Oracle Corporation" - "Java SE 21.0.1"
> /Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home
>     21.0.1 (arm64) "Eclipse Adoptium" - "OpenJDK 21.0.1"
> /Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home
>     1.8.391.13 (x86_64) "Oracle Corporation" - "Java" /Library/Internet
> Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
>
> There is no update available from Java for this plugin.
>
> (You can also see from the above that usr/libexec/java_home does lead to
> the JDK without problem.)
>
> The other possibility is suggested by this code in
> appbundler/native/main.m:
>
> /**
>  *  Searches for a JRE or JDK dylib of the specified version or later.
>  *  First checks the "usual" JRE location, and failing that looks for a
> JDK.
>  *  The version required should be a string of form "1.X". If no version =
is
>  *  specified or the version is pre-1.7, then a Java 1.7 is sought.
>  */
> NSString * findJavaDylib (
>                           NSString *jvmRequired,
>                           bool jrePreferred,
>                           bool jdkPreferred,
>                           bool isDebugging,
>                           bool exactMatch)
> {...}
>
> Since Java is no longer using the nomenclature 1.7, 1.8, etc., then maybe
> this is parsing the name of the version incorrectly? The version here is
> 21, but this method may not be finding it because it expects a string of
> the form 1.x. Might that be the problem?
>
> I will look at this again in more detail when I have more time. Meanwhile=
,
> I really appreciate any suggestions anybody can make.
>
> Cheers,
> Gregory
>
>
> On Nov 17, 2023, at 3:12 AM, Vampire <[email protected]> wrote:
>
> Hi Gregory,
>
> I was about to release 5.7.0 and there also updated the macOS app bundler=
.
> Maybe you could quickly try
> https://www.swisstransfer.com/d/b8bcf63b-b3d3-403c-a0ea-fd3adb6d83bd ?
> Actually, I don't think it changes much in what Java is discovered, from
> what I have seen in the changes, but who knows.
>
> If you are able to read C code, you could maybe see from
> https://github.com/evolvedbinary/appbundler/blob/main/appbundler/native/m=
ain.m
> where Java runtimes are searched for.
> From a very cursory look, I'd say it first searches for `/Library/Interne=
t
> Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java`
> and then uses `/usr/libexec/java_home` to find a matching JVM.
>
> If neither brings a result, it fails.
>
> Besides that Oracle Java is anyway questionable to be used since they
> changed their licensing.
> So maybe you also try with Temurin as Bobb suggested.
>
> Cheers
> Bj=C3=B6rn
>
> Am 07.11.2023 18:07, schrieb Gregory Garretson:
>
> Hi Jack,
>
> Thanks, but I=E2=80=99m afraid it doesn=E2=80=99t seem to. I=E2=80=99ve i=
nstalled both the JRE and
> the JDK, but jEdit still tells me to install Java 11 or later, even thoug=
h
> I get this:
>
> java --version
> java 21.0.1 2023-10-17 LTS
> Java(TM) SE Runtime Environment (build 21.0.1+12-LTS-29)
> Java HotSpot(TM) 64-Bit Server VM (build 21.0.1+12-LTS-29, mixed mode,
> sharing)
>
> Any more thoughts?
>
> Thanks,
> Gregory
>
>
> On Nov 7, 2023, at 4:56 PM, Jack W. <[email protected]>
> <[email protected]> wrote:
>
> Does this help?
> https://docs.oracle.com/en/java/javase/11/install/installation-jdk-macos.=
html
>
> On Tue, Nov 7, 2023 at 9:35=E2=80=AFAM Gregory Garretson <
> [email protected]> wrote:
>
>> Now I have a MacBook with an M3 Apple Silicon processor.
>>
>> My problem is that while jEdit 5.6 successfully installs on the machine,
>> it doesn=E2=80=99t detect Java. It looks for Java 11,
>
>
> --
> Jack Woehr               # If it doesn't work in Firefox,
> Box 82, Beulah CO 81023  # it's broken.
> http://www.softwoehr.com # Just Say No to Chrome.
>
>
>
>
>
>
>
>
>

--0000000000004204ce060a58997d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Yeah, the issue with the naming scheme is reported at=
 <a href=3D"https://github.com/TheInfiniteKind/appbundler/issues/55">https:=
//github.com/TheInfiniteKind/appbundler/issues/55</a>.<br></div><div>But wh=
en no matching version is found and as no `-F` is used, it should then retu=
rn a default and that should hopefully be 21 for you.</div><div>If that is =
the Java 8 one for you, it will then fail for the major version comparison.=
</div><div>But if it returns the Java 21 one, it should usually work.</div>=
<div><br></div><div>What are these four commands returning?</div><div><br><=
/div><div>/usr/libexec/java_home -v 1.11+<br></div><div><br></div><div>jEdi=
t.app/Contents/MacOS/jedit --verbose<br></div><div><br></div><div>echo $JAV=
A_ARCH<br></div><div><br></div><div>find $(/usr/libexec/java_home -V 2&gt;&=
amp;1 | grep Contents/Home | rev | cut -d &#39; &#39; -f 1 | rev | sort -u)=
 -type f -name libjli.dylib<br></div><div><br></div><div><br></div><div>Che=
ers</div><div>Bj=C3=B6rn</div><div><br></div></div><br><div class=3D"gmail_=
quote"><div dir=3D"ltr" class=3D"gmail_attr">Am Fr., 17. Nov. 2023 um 12:16=
=C2=A0Uhr schrieb Gregory Garretson &lt;<a href=3D"mailto:subscriber@garret=
son.info">[email protected]</a>&gt;:<br></div><blockquote class=3D"=
gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(20=
4,204,204);padding-left:1ex"><div>Hi Bj=C3=B6rn,<div><br></div><div>Thanks =
for this. Unfortunately, the new macOS launcher encounters the same problem=
 as the one for 5.6. I get the error message that Java 11 is required, and =
I should update Java. Now, without having dug very deep into the C code, I =
can see two possible reasons for this.</div><div><br></div><div>The first i=
s that it stops when it encounters the Java internet plugin, which in my ca=
se is 1.8:</div><div><br></div><div><div>/usr/libexec/java_home -V</div><di=
v>Matching Java Virtual Machines (3):</div><div>=C2=A0 =C2=A0 21.0.1 (arm64=
) &quot;Oracle Corporation&quot; - &quot;Java SE 21.0.1&quot; /Library/Java=
/JavaVirtualMachines/jdk-21.jdk/Contents/Home</div><div>=C2=A0 =C2=A0 21.0.=
1 (arm64) &quot;Eclipse Adoptium&quot; - &quot;OpenJDK 21.0.1&quot; /Librar=
y/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home</div><div>=C2=A0 =
=C2=A0 1.8.391.13 (x86_64) &quot;Oracle Corporation&quot; - &quot;Java&quot=
; /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home</div><di=
v><br></div><div>There is no update available from Java for this plugin.</d=
iv><div><br></div><div>(You can also see from the above that usr/libexec/ja=
va_home does lead to the JDK without problem.)</div><div><br></div><div>The=
 other possibility is suggested by this code in appbundler/native/main.m:</=
div><div><br></div><div><div>/**</div><div>=C2=A0* =C2=A0Searches for a JRE=
 or JDK dylib of the specified version or later.</div><div>=C2=A0* =C2=A0Fi=
rst checks the &quot;usual&quot; JRE location, and failing that looks for a=
 JDK.</div><div>=C2=A0* =C2=A0The version required should be a string of fo=
rm &quot;1.X&quot;. If no version is</div><div>=C2=A0* =C2=A0specified or t=
he version is pre-1.7, then a Java 1.7 is sought.</div><div>=C2=A0*/</div><=
div>NSString * findJavaDylib (</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 NSString *jvmRequi=
red,</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bool jrePreferred,</div><div>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 bool jdkPreferred,</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bool isDebugging,</div><di=
v>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 bool exactMatch)</div><div>{...}</div></div><div><br></di=
v><div>Since Java is no longer using the nomenclature 1.7, 1.8, etc., then =
maybe this is parsing the name of the version incorrectly? The version here=
 is 21, but this method may not be finding it because it expects a string o=
f the form 1.x. Might that be the problem?</div><div><br></div><div>I will =
look at this again in more detail when I have more time. Meanwhile, I reall=
y appreciate any suggestions anybody can make.</div><div><br></div><div>Che=
ers,</div><div>Gregory</div><div><br></div><div><br><blockquote type=3D"cit=
e"><div>On Nov 17, 2023, at 3:12 AM, Vampire &lt;[email protected]&gt; wrot=
e:</div><br><div>
 =20
   =20
 =20
  <div bgcolor=3D"#FFFFFF">
    <div bgcolor=3D"#FFFFFF">Hi Gregory,</div>
    <div bgcolor=3D"#FFFFFF"><br>
    </div>
    <div bgcolor=3D"#FFFFFF">I was about to release 5.7.0
      and there also updated the macOS app bundler.</div>
    <div bgcolor=3D"#FFFFFF">Maybe you could quickly try=C2=A0<a href=3D"ht=
tps://www.swisstransfer.com/d/b8bcf63b-b3d3-403c-a0ea-fd3adb6d83bd" target=
=3D"_blank">https://www.swisstransfer.com/d/b8bcf63b-b3d3-403c-a0ea-fd3adb6=
d83bd</a>
      ?<br>
      Actually, I don&#39;t think=C2=A0it changes much in what Java is
      discovered, from what I have seen in the changes, but who knows.</div=
>
    <div bgcolor=3D"#FFFFFF"><br>
    </div>
    <div bgcolor=3D"#FFFFFF">If you are able to read C
      code, you could maybe see from=C2=A0<a href=3D"https://github.com/evo=
lvedbinary/appbundler/blob/main/appbundler/native/main.m" target=3D"_blank"=
>https://github.com/evolvedbinary/appbundler/blob/main/appbundler/native/ma=
in.m</a>
      where Java runtimes are searched for.</div>
    <div bgcolor=3D"#FFFFFF">From a very cursory look, I&#39;d
      say it first searches for `/Library/Internet
      Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java`</div>
    <div bgcolor=3D"#FFFFFF">and then uses
      `/usr/libexec/java_home` to find a matching JVM.</div>
    <div bgcolor=3D"#FFFFFF"><br>
    </div>
    <div bgcolor=3D"#FFFFFF">If neither brings a result, it
      fails.</div>
    <div bgcolor=3D"#FFFFFF"><br>
    </div>
    <div bgcolor=3D"#FFFFFF">Besides that Oracle Java is
      anyway questionable to be used since they changed their licensing.</d=
iv>
    <div bgcolor=3D"#FFFFFF">So maybe you also try with
      Temurin as Bobb suggested.</div>
    <div bgcolor=3D"#FFFFFF"><br>
    </div>
    <div bgcolor=3D"#FFFFFF">Cheers</div>
    <div bgcolor=3D"#FFFFFF">Bj=C3=B6rn</div>
    <br>
    <div>Am 07.11.2023 18:07, schrieb Gregory
      Garretson:<br>
    </div>
    <blockquote type=3D"cite">
     =20
      Hi Jack,
      <div><br>
      </div>
      <div>Thanks, but I=E2=80=99m afraid it doesn=E2=80=99t seem to. I=E2=
=80=99ve installed
        both the JRE and the JDK, but jEdit still tells me to install
        Java 11 or later, even though I get this:</div>
      <div><br>
      </div>
      <div><div style=3D"margin:0px;font-style:normal;font-variant-caps:nor=
mal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo=
;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:no=
rmal;font-variant-numeric:normal;font-variant-east-asian:normal;font-featur=
e-settings:normal"><span style=3D"font-variant-ligatures:no-common-ligature=
s">java
            --version</span></div><div style=3D"margin:0px;font-style:norma=
l;font-variant-caps:normal;font-stretch:normal;font-size:11px;line-height:n=
ormal;font-family:Menlo;font-kerning:auto;font-variant-alternates:normal;fo=
nt-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-a=
sian:normal;font-feature-settings:normal"><span style=3D"font-variant-ligat=
ures:no-common-ligatures">java
            21.0.1 2023-10-17 LTS</span></div><div style=3D"margin:0px;font=
-style:normal;font-variant-caps:normal;font-stretch:normal;font-size:11px;l=
ine-height:normal;font-family:Menlo;font-kerning:auto;font-variant-alternat=
es:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-va=
riant-east-asian:normal;font-feature-settings:normal"><span style=3D"font-v=
ariant-ligatures:no-common-ligatures">Java(TM)
            SE Runtime Environment (build 21.0.1+12-LTS-29)</span></div><di=
v style=3D"margin:0px;font-style:normal;font-variant-caps:normal;font-stret=
ch:normal;font-size:11px;line-height:normal;font-family:Menlo;font-kerning:=
auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-vari=
ant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:nor=
mal"><span style=3D"font-variant-ligatures:no-common-ligatures">Java
            HotSpot(TM) 64-Bit Server VM (build 21.0.1+12-LTS-29, mixed
            mode, sharing)</span></div>
      </div>
      <div><span style=3D"font-variant-ligatures:no-common-ligatures"><br>
        </span></div>
      <div><span style=3D"font-variant-ligatures:no-common-ligatures">Any
          more thoughts?</span></div>
      <div><span style=3D"font-variant-ligatures:no-common-ligatures"><br>
        </span></div>
      <div><span style=3D"font-variant-ligatures:no-common-ligatures">Thank=
s,</span></div>
      <div>Gregory</div>
      <div><span style=3D"font-variant-ligatures:no-common-ligatures"><br>
        </span></div>
      <div><br>
        <blockquote type=3D"cite">
          <div>On Nov 7, 2023, at 4:56 PM, Jack W.
            <a href=3D"mailto:[email protected]" target=3D"_blank">&lt;so=
[email protected]&gt;</a> wrote:</div>
          <br>
          <div>
            <div dir=3D"ltr">
              <div dir=3D"ltr">Does this help? <a href=3D"https://docs.orac=
le.com/en/java/javase/11/install/installation-jdk-macos.html" target=3D"_bl=
ank">https://docs.oracle.com/en/java/javase/11/install/installation-jdk-mac=
os.html</a></div>
              <br>
              <div class=3D"gmail_quote">
                <div dir=3D"ltr" class=3D"gmail_attr">On Tue, Nov 7, 2023 a=
t
                  9:35=E2=80=AFAM Gregory Garretson &lt;<a href=3D"mailto:s=
[email protected]" target=3D"_blank">[email protected]</a>&g=
t;
                  wrote:<br>
                </div>
                <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Now I hav=
e a
                  MacBook with an M3 Apple Silicon processor. <br>
                  <br>
                  My problem is that while jEdit 5.6 successfully
                  installs on the machine, it doesn=E2=80=99t detect Java. =
It
                  looks for Java 11,</blockquote>
              </div>
              <br>
              <span class=3D"gmail_signature_prefix">-- </span><br>
              <div dir=3D"ltr" class=3D"gmail_signature">
                <div dir=3D"ltr">
                  <div>
                    <div dir=3D"ltr">
                      <div>
                        <div dir=3D"ltr">
                          <div>
                            <div dir=3D"ltr">
                              <div>
                                <div dir=3D"ltr">
                                  <div>
                                    <div dir=3D"ltr">
                                      <div style=3D"text-align:left">
                                        <div dir=3D"ltr">
                                          <div>
                                            <div dir=3D"ltr">
                                              <div>
                                                <div dir=3D"ltr"><span styl=
e=3D"font-family:monospace">Jack
                                                    Woehr=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
                                                    # If it doesn&#39;t wor=
k
                                                    in Firefox,<br>
                                                    Box 82, Beulah CO
                                                    81023=C2=A0 # it&#39;s
                                                    broken.<br>
                                                    <a href=3D"http://www.s=
oftwoehr.com/" target=3D"_blank">http://www.softwoehr.com</a>
                                                    # Just Say No to
                                                    Chrome.</span><br>
                                                </div>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </blockquote>
      </div>
      <br>
      <br>
      <fieldset></fieldset>
      <br>
      <br>
      <fieldset></fieldset>
      <br>
    </blockquote>
    <br>
  </div>

</div></blockquote></div><br></div></div></blockquote></div>

--0000000000004204ce060a58997d--


--===============2394865353210312922==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============2394865353210312922==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-- 
-----------------------------------------------
jEdit Users' List
[email protected]
https://lists.sourceforge.net/lists/listinfo/jedit-users

--===============2394865353210312922==--