解决Warning Couldn't flush user prefs: java.util.prefs.BackingStoreException: Couldn't get fil

Posted rldts

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决Warning Couldn't flush user prefs: java.util.prefs.BackingStoreException: Couldn't get fil相关的知识,希望对你有一定的参考价值。

系统:Ubuntu 16.04 LTS

环境:vscode+java extension pack打开了一个gradle的java项目;另外,用一个terminal启动了groovysh

报错:

groovysh报错 java.util.prefs.FileSystemPreferences syncWorld
警告: Couldn‘t flush user prefs: java.util.prefs.BackingStoreException: Couldn‘t get file lock.

 

参考资料[1]:https://stackoverflow.com/questions/2027566/java-util-prefs-throwing-backingstoreexception-why

 

解决:

根据[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)

所以,是因为jvm1进程已经获取lock了,导致jvm2无法获取lock而报错

关闭vscode的java项目之后,groovysh不再报错


以上是关于解决Warning Couldn't flush user prefs: java.util.prefs.BackingStoreException: Couldn't get fil的主要内容,如果未能解决你的问题,请参考以下文章

Couldn't resolve host 'mirrorlist.centos.org'解决办法

couldn't parse external etcd version "": Version string empty

yum 安装时错误 Couldn't resolve host 解决办法

解决Couldn't resolve host 'mirrorlist.centos.org

解决HP打印机错误:Couldn't open fifo

解决centos yum源配置出现Couldn't resolve host 问题