系统:Ubuntu 16.04 LTSjava
环境:vscode+java extension pack打开了一个gradle的java项目;另外,用一个terminal启动了groovysheclipse
报错:jvm
groovysh报错 java.util.prefs.FileSystemPreferences syncWorld
警告: Couldn't flush user prefs: java.util.prefs.BackingStoreException: Couldn't get file lock.gradle
参考资料[1]:https://stackoverflow.com/questions/2027566/java-util-prefs-throwing-backingstoreexception-whythis
解决:code
根据[1]中“If two JVMs attempt to lock the file at the same then this is what you'll see.”进程
打开任务管理器,看到两个java进程,一个是vscode java extension 运行的 eclipse jdt 所启动的jvm(jvm1),另外一个是groovysh所启动的jvm(jvm2)ip
因此,是由于jvm1进程已经获取lock了,致使jvm2没法获取lock而报错terminal
关闭vscode的java项目以后,groovysh再也不报错get