Dbviusalizer报错Java.lang.ClassCastException: javax.swing.KeyStroke cannot be cast to java.lang.Compar
前几日重装系统,装了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:
- In the DbVisualizer installation directory there is an .install4j directory,
- In this directory create a file named pref_jre.cfg if it doesn't already exist,
- Open the file in a text editor,
- Add the complete path to the root directory for the Java installation you want to use.
Example: C:\Program Files\Java\jre7
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:
- Java installed with DbVisualizer in DbVisualizer.app/Contents/PlugIns/jre.bundle
- Any installed Java (JRE) in /Library/Internet Plug-Ins/JavaAppletPlugin.plugin
- Last, it looks for a matching Java (JDK) version in /Library/Java/JavaVirtualMachines
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:
- Open a Terminal window
- Execute: cd DbVisualizer.app/Contents
- If the PlugIns folder doesn't exist create it with: mkdir PlugIns
- Execute: cd Plugins
- If there is a jre.bundle link or folder in the PlugIns folder, rename it (for backup purposes) with: mv jre.bundle jre.bundle.ORG
- Create a symbolic link to the new Java version: ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk jre.bundle
- Start DbVisualizer. It now uses the Java version specified by the symbolic link
解决了我的问题,应该也是存在jre的识别问题吧,我配置了jre7也成功,不仅用在jre6
1、找到所在目录C:\Program Files\DbVisualizer-7.1.2\.install4j
2、新增文件(如果没有)
3、增加内容
DBVIS_JAVA_HOME=C:\Program Files\Java\jre7
4、运行成功
Dbviusalizer报错Java.lang.ClassCastException: javax.swing.KeyStroke cannot be cast to java.lang.Compar相关推荐
- JavaWeb: 报错信息The superclass javax.servlet.http.HttpServlet was not found on the Java Build Path...
JavaWeb: 报错信息The superclass "javax.servlet.http.HttpServlet" was not found on the Java Bui ...
- 解决idea启动项目报错:Unable to open debugger port(127.0.0.1:60157):java.net.SocketExceptionsocket closed
转载自 解决idea启动项目报错:Unable to open debugger port(127.0.0.1:60157):java.net.SocketException"socket ...
- java.lang.ClassCastException:android.widget.Button cannot be cast to android.widget.ImageView
今天遇到一个错误也不知道怎么回事,上网搜了一下: 出现的问题是:java.lang.ClassCastException:android.widget.Button cannot be cast to ...
- java报错Error attempting to get column ‘XXX’ from result set. Cause: java.sql.怎么解决
错误1: java中的实体类用到了LocalDateTime 类型. 在转换时候报错 Error attempting to get column 'XXX' from result set. Cau ...
- jsp 学习笔记( java编译报错:程序包 javax.servlet和javax.servlet.http 不存在)
最近学习javaEE这门课程,老师要求不用集成开发环境只用 tomcat (服务器).java 和 浏览器 实现jsp过程,要编译的java文件如下 import javax.servlet.*; i ...
- Mybatis报错There is no getter for property named 'id' in 'class java.lang.String'
昨天运行公司项目的一个模块时,后台报了一个错: Caused by: org.apache.ibatis.reflection.ReflectionException: There is no get ...
- shiro缓存管理时报错java.lang.ClassCastException: com.xxx.User cannot be cast to com.xxx.User
一.异常 java.lang.ClassCastException: com.px.myshiro.domain.User cannot be cast to com.px.myshiro.domai ...
- java.lang.ClassCastException: com.xx.User cannot be cast to com.xx.User
项目使用spring boot1.5.2 集成mybatis通用mapper插件,发现查询方法selectByPrimaryKey 会导致发生异常-- java.lang.ClassCastExcep ...
- shiro中devtools:java.lang.ClassCastException: cn.model.User cannot be cast to cn.model.User
今天意外发现一个exception:java.lang.ClassCastException:cn.system.model.User cannot be cast to cn.system.mode ...
- java.lang.classcastexception怎么解决_抛出奇怪的java.lang.ClassCastException
我正在试验JPA和Glassfish 4.0. 我写了这样的用户类(只是相关的部分,我不确定它是否编译): public class User implements Serializable { pr ...
最新文章
- mysql的replace()函数介绍【mysql函数】
- Struts2的properties配置文件详解
- UVA-10954 Add All
- mybatis中mysql流式读取_MyBatis读取大量数据(流式读取)
- spring batch @EnableBatchProcessing作用
- mysql OA_mysql优化工具—mysqloa
- 黑客内鬼窃取华尔街金融服务公司核心交易算法
- [有限元] 面积坐标的幂函数在三角形单元,三角形环单元上的积分公式和体积坐标的幂函数在常应变四面体单元上的积分公式
- Ext 组件的一些操作
- 员工借款及还款场景演练
- mongodb创建图书管理_基于MongoDB的云数据库管理系统的设计与实现
- base64与图片互换
- 朱晔的互联网架构实践心得S1E1:Pilot
- 1月好书推荐-8本值得读的好书,让你受益终生
- Shi-Tomasi角点检测算法
- java启动临时文件_File.createTempFile创建临时文件的示例详解
- 分享一下支付宝的支付(soEasy)
- 华为eNSP防火墙USG5500基本配置
- PHP快手直播弹幕采集,获取斗鱼弹幕php版(原创)
- HTML 教程:基础标签
热门文章
- visio怎么画球_cad怎么画装配图
- 目前最值得购买的两种上网神器?看完你会选择哪一款?
- No.4 - 第一章 启航 - 什么是事件驱动型应用 | Flink 知其然,知其所以然
- 计算机显示无法格式化,SD卡无法格式化怎么办
- 小学计算机网络教室简介,市中小学计算机网络教室(网络学习室)
- 客户画像--指标标签体系设计方案----业务视角
- 3.4 Go语言从入门到精通:包管理工具之Go module
- 无心剑中译约翰·拉伯克《书海乐无穷》
- 年底绩效考核,领导让我背「C」
- 蛋白组学搜库分析软件 MaxQuant使用教程