记一次解决Visual Paradigm打开始终是在Initializing Environment的问题

1、问题描述:mac下的Visual Paradigm第一次打开的时候,卡死在了Initializing Environment的slash页面上


分析过程:

a、因为知道VP是使用java编写的,打开启动脚本:

cd /Applications/Visual\ Paradigm\ 12.2/scripts

发现VP的启动脚本:VisualParadigm.sh 内容是:

#!/bin/sh
cd ../bin
JAVA="../jre/bin/java"
if [ ! -f "$JAVA" ]; then
    JAVA="../../jre/bin/java"
fi

if [ ! -f "$JAVA" ]; then
    JAVA="java"
fi

"$JAVA" -Xms256m -Xmx768m -XX:MaxPermSize=256m -cp ".:../lib/vpplatform.jar:../lib/jniwrap.jar:../lib/winpack.jar:../ormlib/orm.jar:../ormlib/orm-core.jar:../lib/xalan.jar:../lib/lib01.jar:../lib/lib02.jar:../lib/lib03.jar:../lib/lib04.jar:../lib/lib05.jar:../lib/lib06.jar:../lib/lib07.jar:../lib/lib08.jar:../lib/lib09.jar:../lib/lib10.jar:../lib/lib11.jar:../lib/lib12.jar:../lib/lib13.jar:../lib/lib14.jar:../lib/lib15.jar:../lib/lib16.jar:../lib/lib17.jar:../lib/lib18.jar:../lib/lib19.jar:../lib/lib20.jar" RV "$@"

b、简化脚本并指定指定verbose选项:

最后发现卡死在了,然后Ctrl+c发现错误信息为:

error in dlopen: dlopen(libmlib_image.dylib, 1): image not found

c、增加-verbose:jni

发现错误信息为

[Dynamic-linking native method java.awt.image.Kernel.initIDs ... JNI]
[Dynamic-linking native method sun.java2d.pipe.ShapeSpanIterator.intersectClipBox ... JNI]
[Dynamic-linking native method sun.java2d.loops.MaskBlit.MaskBlit ... JNI]
[Dynamic-linking native method sun.awt.image.ImagingLib.init ... JNI]
[Dynamic-linking native method java.lang.Shutdown.halt0 ... JNI]
error in dlopen: dlopen(libmlib_image.dylib, 1): image not found

d、第一次以为是调用JNI出现的问题,但是发现/Library/Java/JavaVirtualMachines/jdk1.7.0_72.jdk/Contents/Home/jre/lib目录下有 libmlib_image.dylib文件,所以排除这种可能,猜测可能是其他动态库中的程序调用这个动态库,拷贝libmlib_image.dylib到/usr/lib/下,重新跑起VP,ok~~


后记:

整个过程比这个要复杂很多的,不过基本流程是这样的。很多软件问题,只要一点一点分析,就能解决的~~


你可能感兴趣的:(java,Visual,Paradigm)