Nov 13, 2014

解决eclipse4.3.1 ctrl click不工作的问题

升级eclipse到Kepler(4.3.1)之后,发现ctrl+click函数声明追踪不好使了,股沟了一下,原来是dltk的数据库版本不向下兼容:

!ENTRY org.eclipse.dltk.core.index.sql 4 0 2013-10-14 16:45:28.670
!MESSAGE An exception has thrown while performing a search
!STACK 0
org.h2.jdbc.JdbcSQLException: 
Unsupported database file version or invalid file header in file "Old database: 
/home//workspace/.metadata/.plugins/org.eclipse.dltk.core.index.sql.h2/model.data.db 
- 
please convert the database to a SQL script and re-create it." [90048-168]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)

解决办法:

关闭eclipse,把workspace/.metadata/.plugins/org.eclipse.dltk.core.index.sql.h2/目录下的文件全部删除,再打开eclipse,它会自动重建声明索引数据库。

PS,期间遇到“workspace in use or cannot be created”的问题,到workspace/.metadat/目录下,删除.lock文件,轻松解决。