Menu

#4124 jEdit Won't Load when $JAVA_HOME is set

normal bug
closed
nobody
None
5
2023-05-03
2023-05-02
ScreenName
No

When $JAVA_HOME is defined in .bashrc

jpolanik@Jill:~/Documents/myRaku/PDF_Tool$ which java
/usr/bin/java

jpolanik@Jill:~$ echo $JAVA_HOME
/usr/bin/java

jpolanik@Jill:~$ jedit
/home/jpolanik/bin/jedit: 24: exec: /usr/bin/java/bin/java: not found

jEdit does not load at all

When $JAVA_HOME is not defined in .bashrc

jpolanik@Jill:~$ echo $JAVA_HOME

jpolanik@Jill:~$ jedit
Warning: $JAVA_HOME environment variable not set! Consider setting it.
Attempting to locate java...
Found a virtual machine at: /usr/bin/java...

jEdit loads and appears to run as expected; but, without $JAVA_HOME other java apps may have a problem.

I'm running Ubuntu 22.04.2 LTS on an Intel processor, with:
openjdk version "19.0.2" 2023-01-17
OpenJDK Runtime Environment (build 19.0.2+7-Ubuntu-0ubuntu322.04)

Joseph Polanik

Related

Bugs: #4124

Discussion

  • Dale Anson

    Dale Anson - 2023-05-02

    What's in your ~/bin/jedit file? Is that a shell script to start jEdit?

     
    • ScreenName

      ScreenName - 2023-05-02

      Yes, ~/bin/jedit is the application launcher that came with jEdit

      !/bin/sh

      Runs jEdit - Programmer's Text Editor.

      Find a java installation.

      if [ -z "${JAVA_HOME}" ]; then
      echo 'Warning: $JAVA_HOME environment variable not set! Consider setting
      it.'
      echo ' Attempting to locate java...'
      j=which java 2>/dev/null
      if [ -z "$j" ]; then
      echo "Failed to locate the java virtual machine! Bailing..."
      exit 1
      else
      echo "Found a virtual machine at: $j..."
      JAVA="$j"
      fi
      else
      JAVA="${JAVA_HOME}/bin/java"
      fi

      Launch application.

      exec "${JAVA}" -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -jar
      "/home/jpolanik/jEdit/5.6.0/jedit.jar" -reuseview "$@"

       

      Last edit: ScreenName 2023-05-02
      • ScreenName

        ScreenName - 2023-05-02

        Okay, thanks for drawing my attention to the application launcher, Dale.

        The problem goes away when I replaced the original line

        JAVA="${JAVA_HOME}/bin/java"

        with

        JAVA="${JAVA_HOME}"

         
        • Joe Robertson

          Joe Robertson - 2023-05-03

          I dont have Ubuntu 22, but in Ubuntu 20 it works as deployed. I will
          verify when I get to work.

          JAVA_HOME should be the jdk-19 folder, and not the jdk-19/bin or
          jdk-19/bin/java as it appears to be here.
          Of course in Ubuntu theres a layer of indirection with the debian
          application symlinks.
          OR the jdk19 install did something different? It would not surprise me if
          Oracle changed a 30yo directory layout just to jerk with everyone.

          How did you install the jdk?

          On Tue, May 2, 2023 at 6:30 PM ScreenName via jEdit-devel jedit-devel@lists.sourceforge.net wrote:

          Okay, thanks for drawing my attention to the application launcher, Dale.

          The problem goes away when I replaced the original line

          JAVA="${JAVA_HOME}/bin/java"

          with

          JAVA="${JAVA_HOME}"


          Status: open
          Group: normal bug
          Created: Tue May 02, 2023 08:03 PM UTC by ScreenName
          Last Updated: Tue May 02, 2023 10:35 PM UTC
          Owner: nobody

          When $JAVA_HOME is defined in .bashrc

          jpolanik@Jill:~/Documents/myRaku/PDF_Tool$ which java
          /usr/bin/java

          jpolanik@Jill:~$ echo $JAVA_HOME
          /usr/bin/java

          jpolanik@Jill:~$ jedit
          /home/jpolanik/bin/jedit: 24: exec: /usr/bin/java/bin/java: not found

          jEdit does not load at all

          When $JAVA_HOME is not defined in .bashrc

          jpolanik@Jill:~$ echo $JAVA_HOME

          jpolanik@Jill:~$ jedit
          Warning: $JAVA_HOME environment variable not set! Consider setting it.
          Attempting to locate java...
          Found a virtual machine at: /usr/bin/java...

          jEdit loads and appears to run as expected; but, without $JAVA_HOME other
          java apps may have a problem.

          I'm running Ubuntu 22.04.2 LTS on an Intel processor, with:
          openjdk version "19.0.2" 2023-01-17
          OpenJDK Runtime Environment (build 19.0.2+7-Ubuntu-0ubuntu322.04)

          Joseph Polanik

          Sent from sourceforge.net because jedit-devel@lists.sourceforge.net is
          subscribed to https://sourceforge.net/p/jedit/bugs/

          To unsubscribe from further messages, a project admin can change settings
          at https://sourceforge.net/p/jedit/admin/bugs/options. Or, if this is a
          mailing list, you can unsubscribe from the mailing list.
          --


          jEdit Developers' List
          jEdit-devel@lists.sourceforge.net
          https://lists.sourceforge.net/lists/listinfo/jedit-devel

           

          Related

          Bugs: #4124

          • ScreenName

            ScreenName - 2023-05-03

            Joe,

            I installed the JDK by installing the Ubuntu package. There is a certain amount of indirection involved here.

            which java returns /usr/bin/java which is a link to /etc/alternatives/javawhich is a link to /usr/lib/jvm/java-19-openjdk-amd64/bin/java.

            Once I set JAVA_HOME to /usr/lib/jvm/java-19-openjdk-amd64, the original launcher script works as expected.
            
            Regards,
            
             

            Last edit: ScreenName 2023-05-03
  • ScreenName

    ScreenName - 2023-05-02
     

    Last edit: ScreenName 2023-05-03
  • Dale Anson

    Dale Anson - 2023-05-03
    • status: open --> closed
     
  • Dale Anson

    Dale Anson - 2023-05-03

    Closing as the OP fixed the problem. This issue really isn't a jEdit problem anyway, it's the Ubuntu packaging that has problem. I don't know who maintains the Ubuntu package, but that's where the real fix should be.

     

Log in to post a comment.

MongoDB Logo MongoDB