Menu

#1310 Mac OS installation does not run

Snapshot
closed-fixed
nobody
None
5
2019-01-18
2017-09-21
Eric Nadler
No

I downloaded the squirrel-sql-snapshot-20170920_0729-MACOSX-install.jar install.

After the default installation with no plug ins, double clicking the app does nothing.

Manually running the startup script gets an error:
/Applications $ SQuirreLSQL.app/Contents/MacOS/squirrel-sql.sh
SQuirreLSQL.app/Contents/MacOS/squirrel-sql.sh: line 26: Plug-Ins/JavaAppletPlugin.plugin/Contents/Home: No such file or directory

Here is my java version:
/Applications $ java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

I'm running Mac OS X 10.12.5 Sierra on a MacBook Pro.

In the startup script I then manually set JAVACMD:

In file "/Users/enadler/Documents/squirrel-sql.sh":

34: #if [ -d "$JAVA_HOME" -a -x "$JAVA_HOME/bin/java" ]; then
35: # JAVACMD="$JAVA_HOME/bin/java"
36: #elif [ -d "$IZPACK_JAVA_HOME" -a -x "$IZPACK_JAVA_HOME/bin/java" ]; then
37: # JAVACMD="$IZPACK_JAVA_HOME/bin/java"
38: #else
39: # JAVACMD=java
40: #fi
41: JAVACMD="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java"

I commented out the versioncheck.

I put double quotes around $JAVACMD at the end so that it would run correctly since there is a space in the path.

At this point I got a different error:
/Applications $ SQuirreLSQL.app/Contents/MacOS/squirrel-sql.sh
Error: Could not find or load main class net.sourceforge.squirrel_sql.client.Main

This is where I gave up.

Thanks for any help you can provide!
Eric

Discussion

1 2 > >> (Page 1 of 2)
  • Jörn

    Jörn - 2017-09-27

    Hello Eric
    have the same problem the last days. I have take a small change in the squirrel-sql.sh.

    My directory looks lie this:
    tree -L 3 /Applications/SQuirreLSQL.app/
    /Applications/SQuirreLSQL.app/
    ├── Contents
    │   ├── Info.plist
    │   ├── MacOS
    │   │   └── squirrel-sql.sh
    │   └── Resources
    │   ├── Java
    │   └── acorn.icns
    ├── Uninstaller
    │   └── uninstaller.jar
    └── plugins
    ├── greenplum
    │   └── doc
    ├── greenplum.jar
    ├── multisource
    │   └── doc
    ├── multisource.jar
    ├── swingViolations
    │   └── doc
    ├── swingViolations.jar
    ├── vertica
    │   └── doc
    ├── vertica.jar
    ├── wikiTableConfigurations
    └── wikiTableConfigurations.jar

    15 directories, 9 files

    The problem in my case was around a bad placing of the squirrel-sql.sh script. I don't know why it was there in my case, but i have changed the script to follow my situation. I think the change should also run in your case. the old line is commented out:
    [Change in squirrel-sql.sh]

    # SQuirreL home.
    if $macosx ; then
    #    SQUIRREL_SQL_HOME=`dirname "$0"`/Contents/Resources/Java
        SQUIRREL_SQL_HOME=$(echo "$(dirname "$0")" | grep -o '^/.*/Contents/')/Resources/Java       
        if [ ! -d "$SQUIRREL_SQL_HOME" ]; then
            # We assume that this is the ZIP file extracted on MacOS,
            # so, fall-back to the defult path
            SQUIRREL_SQL_HOME=`dirname "$0"`
        fi
    
    else 
            SQUIRREL_SQL_HOME='/Applications/SQuirreLSQL.app'
    fi
    

    change is around line 54

     
  • Gerd Wagner

    Gerd Wagner - 2017-10-02

    Eric and Jörn,

    thanks for your efforts.

    Please let me know if both of you think Jörn's change is the right thing to do.
    If so I'll commit the fix to our Git repository.

    Thanks in advance
    Gerd

     
  • Jörn

    Jörn - 2017-10-02

    Hi Gerd
    i have double check the dir tree in case of installation with installer.
    here is macos 10.12.6 running and with this setup after the normal installation, the change helps that squirrel is running out of the box.

    i think it can go in git repository but if there is anyone else who can check the change and also the problem, i would be happy.

    regards
    Jörn

     
  • Andy Bravo

    Andy Bravo - 2017-10-10

    Hi, I have a similar issue trying to run SQuirreL on Mac, this is the error that is throwing: Error: Could not find or load main class JavaVersionChecker.

    How can I solve this, or where do I look for solve it?

    Thanks!

     
  • Jörn

    Jörn - 2017-10-11

    Hi Andy
    Look at my post from 27/9/17. Follow the instructions and then it should go. Important for my solution is, that there is an directory called Contents in your directory tree. If you need more help, post here your directory tree.
    Regards Jörn

     
  • Roel

    Roel - 2017-10-11

    Hello all,

    I'have the same issue on macOS High Sierra. I modify the squirrel-sql.sh but still the same issue.
    .
    ├── Contents
    │   ├── Info.plist
    │   ├── MacOS
    │   │   └── squirrel-sql.sh
    │   └── Resources
    │   ├── Java
    │   │   ├── doc
    │   │   ├── lib
    │   │   ├── log4j.properties
    │   │   ├── plugins
    │   │   ├── squirrel-sql.jar
    │   │   └── update-log4j.properties
    │   └── acorn.icns
    └── Uninstaller
    └── uninstaller.jar

    Regards,

    Valentin

     
    • Jörn

      Jörn - 2017-10-11

      Can you please copy the Java Directory into the Resources folder. i think then it should go.

       
      • Roel

        Roel - 2017-10-11

        It's was a typo issue when i copy past the tree. Java folder is already in Resources:

        .
        ├── Contents
        │   ├── Info.plist
        │   ├── MacOS
        │   │   └── squirrel-sql.sh
        │   ├── Resources
        │   │   ├ ── Java
        │   │   │   ├── doc
        │   │   │   ├── lib
        │   │   │   ├── log4j.properties
        │   │   │   ├── plugins
        │   │   │   ├── squirrel-sql.jar
        │   │   │   └── update-log4j.properties
        │   │   └── acorn.icns
        │   └── acorn.icns
        └── Uninstaller
        └── uninstaller.jar

         
        • Jörn

          Jörn - 2017-10-11

          OK, not good.
          Can you post your output when you run squirrel-sql.sh from cmd?
          can you check that under Contents/Resources/Java/lib/ is the file versioncheck.jar.

           
          • Roel

            Roel - 2017-10-11

            versioncheck.jar is in the Contents/Resources/Java/lib folder.
            Here you go:

            ./squirrel-sql.sh
            ./squirrel-sql.sh: line 26: Plug-Ins/JavaAppletPlugin.plugin/Contents/Home: No such file or directory
            Error: Could not find or load main class JavaVersionChecker

             
            • Jörn

              Jörn - 2017-10-11

              Please add a -x to the shebang in squirrel-sql.sh and then run the command on cmd. After that please post the output.

              Shebang is the first line in the suirrel-sql.sh script.
              should look like this
              #! /bin/sh -x

               

              Last edit: Jörn 2017-10-11
              • Roel

                Roel - 2017-10-11

                Here you go :
                ./squirrel-sql.sh
                + IZPACK_JAVA_HOME=/Library/Internet
                + Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
                ./squirrel-sql.sh: line 26: Plug-Ins/JavaAppletPlugin.plugin/Contents/Home: No such file or directory
                + '[' -d /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home -a -x /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java ']'
                + JAVACMD=/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java
                + cygwin=false
                + macosx=false
                + case "uname -s" in
                ++ uname -s
                + macosx=true
                + true
                ++ grep -o '^/.*/Contents/'
                +++ dirname ./squirrel-sql.sh
                ++ echo .
                + SQUIRREL_SQL_HOME=/Resources/Java
                + '[' '!' -d /Resources/Java ']'
                ++ dirname ./squirrel-sql.sh
                + SQUIRREL_SQL_HOME=.
                + false
                + UNIX_STYLE_HOME=.
                + cd .
                + /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java -cp ./lib/versioncheck.jar JavaVersionChecker 1.6 1.7 1.8 9
                Error: Could not find or load main class JavaVersionChecker
                + '[' 1 = 1 ']'
                + exit

                 
                • Jörn

                  Jörn - 2017-10-11

                  OK, there could be the Problem.
                  You run the script direct out of the folder with cd'ing in that folder before. So the dirname command return as path just a dot.

                  please run the script out of your home directory with eg: /Applications/SQuirreLSQL.app/Contents/MacOS/squirrel-sql.sh (change to suite your environment)

                  i think then it should start. If not, please provide the output from the cmd line

                   
                  • Roel

                    Roel - 2017-10-11

                    Oh ok ! It's working ! Thanks!

                    Sorry for wasting your time on this !

                     
                    • Jörn

                      Jörn - 2017-10-11

                      No prob, have fun with the Squirrel

                       
  • Jörn

    Jörn - 2017-10-11

    @all
    Following new Version of the squirrel-sql.sh script that now also suite the Problem when running not from the home directory like Roel did.

    ####### squirrel-sql.sh
      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    #! /bin/sh -x
    
    ABSPATH=$(cd "$(dirname "$0")"; pwd)
    
    # This function sets a global variable named "CP" to a command-path separated list of jars located beneath the 
    # specified folder.  If the specified folder contains a lib directory, then jars beneath the lib folder are 
    # @ added as well as the squirrel-sql.jar file located in the directory specified as the first argument to 
    # this function. 
    buildCPFromDir()
    {
        CP=""
        if [ -d "$1"/lib ]; then
            # First entry in classpath is the Squirrel application.
            CP="$1/squirrel-sql.jar"
    
            # Then add all library jars to the classpath.
            for a in "$1"/lib/*; do
                CP="$CP":"$a"
            done
        else 
            for a in "$1"/*; do
                CP="$CP":"$a"
            done
        fi
    } 
    
    # IZPACK_JAVA_HOME is filtered in by the IzPack installer when this script is installed
    IZPACK_JAVA_HOME=/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
    
    # We detect the java executable to use according to the following algorithm:
    #
    # 1. If it is located in JAVA_HOME, then we use that; or
    # 2. If the one used by the IzPack installer is available then use that, otherwise
    # 3. Use the java that is in the command path.
    # 
    if [ -d "$JAVA_HOME" -a -x "$JAVA_HOME/bin/java" ]; then
        JAVACMD="$JAVA_HOME/bin/java"
    elif [ -d "$IZPACK_JAVA_HOME" -a -x "$IZPACK_JAVA_HOME/bin/java" ]; then
        JAVACMD="$IZPACK_JAVA_HOME/bin/java"
    else
        JAVACMD=java
    fi
    
    # Are we running within Cygwin on some version of Windows or on Mac OS X?
    cygwin=false;
    macosx=false;
    case "`uname -s`" in
        CYGWIN*) 
            cygwin=true 
            ;;
        Darwin*) 
            macosx=true
            ;;
    esac
    
    # SQuirreL home.
    if $macosx ; then
    #    SQUIRREL_SQL_HOME=`dirname "$0"`/Contents/Resources/Java
        SQUIRREL_SQL_HOME=$(echo $ABSPATH | grep -o '^/.*/Contents/')Resources/Java
        if [ ! -d "$SQUIRREL_SQL_HOME" ]; then
            # We assume that this is the ZIP file extracted on MacOS,
            # so, fall-back to the defult path
            SQUIRREL_SQL_HOME=`dirname "$0"`
        fi
    
    else 
        SQUIRREL_SQL_HOME='/Applications/SQuirreLSQL.app'
    fi
    
    # SQuirreL home in Unix format.
    if $cygwin ; then
        UNIX_STYLE_HOME=`cygpath "$SQUIRREL_SQL_HOME"`
    else
        UNIX_STYLE_HOME="$SQUIRREL_SQL_HOME"
    fi
    
    cd "$UNIX_STYLE_HOME"
    
    # Check to see if the JVM meets the minimum required to run SQuirreL and inform the user if not and skip 
    # launch.  versioncheck.jar is a special jar file which has been compiled with javac version 1.2.2, which 
    # should be able to be run by that version or higher. The arguments to JavaVersionChecker below specify the 
    # minimum acceptable version (first arg) and any other acceptable subsequent versions.  <MAJOR>.<MINOR> should 
    # be all that is necessary for the version form. 
    $JAVACMD -cp "$UNIX_STYLE_HOME/lib/versioncheck.jar" JavaVersionChecker 1.6 1.7 1.8
    if [ "$?" = "1" ]; then
        exit
    fi
    
    # Build a command-path separated list of installed jars from the lib folder and squirrel-sql.jar
    buildCPFromDir "$UNIX_STYLE_HOME"
    TMP_CP=$CP
    
    # Now add the system classpath to the classpath. If running
    # Cygwin we also need to change the classpath to Windows format.
    if $cygwin ; then
        TMP_CP=`cygpath -w -p $TMP_CP`
        TMP_CP=$TMP_CP';'$CLASSPATH
    else
        TMP_CP=$TMP_CP:$CLASSPATH
    fi
    
    if $macosx ; then
        # Define mac-specific system properties if running on Mac OS X
        MACOSX_SQUIRREL_PROPS="-Dapple.laf.useScreenMenuBar=true -Dcom.apple.mrj.application.apple.menu.about.name=SQuirreLSQL"
        NATIVE_LAF_PROP="--native-laf"
    fi
    
    if $macosx ; then
        # macosx provides unknown args to the script, causing SQuirreL to bail..
        SCRIPT_ARGS=""
    else
        SCRIPT_ARGS="$1 $2 $3 $4 $5 $6 $7 $8 $9"
    fi
    
    # Now, pickup all jars once again from the installation and lib directories. The variable "CP" is assigned this value.
    buildCPFromDir "$UNIX_STYLE_HOME"
    
    # Launch SQuirreL application
    $JAVACMD -Xmx256m -cp "$CP" $MACOSX_SQUIRREL_PROPS -splash:"$SQUIRREL_SQL_HOME/icons/splash.jpg" net.sourceforge.squirrel_sql.client.Main --log-config-file "$UNIX_STYLE_HOME"/log4j.properties --squirrel-home "$UNIX_STYLE_HOME" $NATIVE_LAF_PROP $SCRIPT_ARGS
    

    The change run for me with absolute and relative path.

     

    Last edit: Jörn 2017-10-11
  • Eric Nadler

    Eric Nadler - 2017-10-11

    The suggested change to the script worked for me! Thank you!

     
  • Gerd Wagner

    Gerd Wagner - 2017-10-13

    Thanks to all for the discussion and especially to Jörn for providing the script. It was my feeling at this point I better introduce separate scripts for Linux/Unix and MACOS. So based on Jörn's suggestions I created the new MACOS only script and am going to release a new snapshot containing it within the next hour. Could at best all of you check if it works.

    Thanks again Gerd

     
  • Gerd Wagner

    Gerd Wagner - 2017-10-18

    Ok, no news is good news.

    The changes are committed.

     
  • Gerd Wagner

    Gerd Wagner - 2017-10-18
    • status: open --> closed-fixed
     
  • Dan Rohtbart

    Dan Rohtbart - 2017-10-20

    Continuing to have the same problem with squirrel-sql-snapshot-20171018_2131-MACOSX-install. Exact same symptoms (won't open, calling from Terminal gives same error).

    Upon investigation, Jorn's recommended changes (the missing -x) https://sourceforge.net/p/squirrel-sql/bugs/1310/#0aee were not in the squirrel-sql.sh. Once I pasted in the script from that post, I'm able to double-click SQuirreLSQL.app and it runs fine.

    (I had installed that snapshot over a 3.8 install...perhaps the new install didn't overwrite my existing squirrel-sql.sh?)

     

    Last edit: Dan Rohtbart 2017-10-20
  • Domenico Neri

    Domenico Neri - 2017-11-04

    same problem with high sierra 10.13.1 and jdk 1.8.0_152-b16)

    solved with:
    cp -r /Applications/SQuirreLSQL.app/Contents/Resources/Java/* /Applications/SQuirreLSQL.app/Contents/MacOS/

    probably it is not the best solution ...but worked

    bye
    Domenico

     
  • Gerd Wagner

    Gerd Wagner - 2017-11-17

    The change made for this bug was reverted because of the discussion in bug
    https://sourceforge.net/p/squirrel-sql/bugs/1321/

    Since there seems to be no version that works for all Mac users the problem is well documented in the script itself to allow users to change the script and to try out which version works for them.

     
  • Ross

    Ross - 2018-01-19

    I just attempted to install Squirrel on my Mac and have the same problems as described above. Same errors.

     
    • Jörn

      Jörn - 2018-01-19

      Have you reed the posts above?
      What is the result of the respective investigations?

       
1 2 > >> (Page 1 of 2)

Log in to post a comment.