programing/IDE

JAVA 업데이트 후 SQuirrelSQL 실행안될때

ZelKun 2019. 4. 26. 15:02
반응형

Java를 새로 설치했더니 Java 버전이 10.0.1으로 업데이트를 해버림

터미널에서 java -version을 실행시…

 

admin:~ admin$ java -version

java version "10.0.1" 2018-04-17

Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)

Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)

admin:~ admin

 

그래서 그런지 SQuirrelSQL 앱이 실행이 전혀 안되네요

 

그래서 JAVA(JDK) 버전을 컨트롤 할 수 있다는 JENV를 설치해서 1.8로 변경해놨지만

admin:~ admin$ jenv versions

  system

  1.6

  1.6.0.65

  1.7

  1.7.0.80

* 1.8 (set by /Users/admin/.jenv/version)

  1.8.0.171

  10.0

  10.0.1

  oracle64-1.6.0.65

  oracle64-1.7.0.80

  oracle64-1.8.0.171

  oracle64-10.0.1

admin:~ admin$ 

 

Internet Plug-Ins에는 아직 10 버전을 뿌려줍니다

admin:MacOS admin$ /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version

java version "10.0.1" 2018-04-17

Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)

Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)

admin:MacOS admin

 

머리아프니 app 실행에 사용되는 squirrel-sql.sh 를 수정해줬습니다

IZPACK_JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home

SQUIRREL_SQL_HOME=/Applications/SQuirreLSQL.app/Contents/Resources/Java

 

admin:~ admin$ cd /Applications/SQuirreLSQL.app/Contents/MacOS/

admin:MacOS admin$ ls

squirrel-sql.sh

admin:MacOS admin$ vim squirrel-sql.sh

 

내리다보면 33번 라인쯤에 IZPACK_JAVA_HOME이 보이는데

 23                 for a in "$1"/lib/*; do

 24                         CP="$CP":"$a"

 25                 done

 26         else

 27                 for a in "$1"/*; do

 28                         CP="$CP":"$a"

 29                 done

 30         fi

 31 }

 32 

 33 # IZPACK_JAVA_HOME is filtered in by the IzPack installer when this script is installed

 34 #IZPACK_JAVA_HOME=/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home

 35 

 36 IZPACK_JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home

 37 

 38 # We detect the java executable to use according to the following algorithm:

 39 #

 40 # 1. If it is located in JAVA_HOME, then we use that; or

 41 # 2. If the one used by the IzPack installer is available then use that, otherwise

36번 라인에 IZPACK_JAVA_HOME경로를 jdk 1.8로 넣어주고

 

SQUIRREL_SQL_HOME을 찾아서 수정해 줍니다

 71 #    SQUIRREL_SQL_HOME=$(echo $ABSPATH | grep -o '^/.*/Contents/')Resources/Java

 72 #    SQUIRREL_SQL_HOME=`dirname "$0"`/../Resources/Java

 73 

 74 SQUIRREL_SQL_HOME=/Applications/SQuirreLSQL.app/Contents/Resources/Java

 75 

 76 

 77     if [ ! -d "$SQUIRREL_SQL_HOME" ]; then

 78         # We assume that this is the ZIP file extracted on MacOS,

 79         # so, fall-back to the defult path

 80         SQUIRREL_SQL_HOME=`dirname "$0"`

 81     fi

 82 else

 83     SQUIRREL_SQL_HOME='/Applications/SQuirreLSQL.app'

 84 fi

 85 

 86 # SQuirreL home in Unix format.

 87 UNIX_STYLE_HOME="$SQUIRREL_SQL_HOME"

 88 

 89 cd "$UNIX_STYLE_HOME"

 90 

 91 # Check to see if the JVM meets the minimum required to run SQuirreL and inform the user if not and skip

쭉내리다보면  SQUIRREL_SQL_HOME이 보이는데 /Applications/SQuirreLSQL.app/Contents/Resources/Java를 보도록 변경

둘다 수정하고 실행하니 잘돌아갑니다

SQUIRREL_SQL_HOME에는 원래 상대경로가 들어가는데... 아래내려가다보면 ./lib를 찾는 구문이 있는데 정확하게는 Java/lib로 들어가야되는데 해당 디렉토리가 없어서 쉘이 중간에 끝나버리니

 

사실 10버전을 삭제해버리면 되는거지만…..


반응형