前几日重装系统,装了java8,今天运行DbVisualizer时,报Java.lang.ClassCastException: javax.swing.KeyStroke cannot be cast to java.lang.Comparable 这样的错误。真是怪事。我的DbVisualizer版本是7.0.5,好像是该版本不支持java8,只能在java6下运行,由于种种原因吧,不想升级。后来在官网上找到了答案,只要新建个DBVIS_JAVA_HOME环境变量,指定你想要的jre版本就可以了。正常运行,截图如下:
官网解释:http://confluence.dbvis.com/pages/viewpage.action?pageId=3146120
另:只有spring4以上才支持java8,所以系统装了java8后如果想正常运行spring4以下的程序,需要指定运行的jre版本,当然是8以下的。
原博客地址http://blog.csdn.net/tegwy/article/details/38584233,感谢原博主
===============================================================================================
我的版本也是7.0.5,昨天安装了JDK7,今天就报错了,如上配置
Windows/Unix/Linux:
An alternative solution is to set the DBVIS_JAVA_HOME environment variable to point to the root directory for the Java installation.
Example: DBVIS_JAVA_HOME=C:\Program Files\Java\jre7
Mac OS X:
On Mac OS X, this is the search order for Java when launching DbVisualizer:
If you want to use a different Java version, you must download and install the Java JDK for that version (there is no way to select a specific JRE version). The new JDK version is installed in /Library/Java/JavaVirtualMachines/.
Do as follows to change so that DbVisualizer use the new Java version:
1、找到所在目录C:\Program Files\DbVisualizer-7.1.2\.install4j
2、新增文件(如果没有)
3、增加内容
DBVIS_JAVA_HOME=C:\Program Files\Java\jre7
4、运行成功