Play 框架:无法加载 JNotify 本机库 [英] Play Framework: Cannot load the JNotify native library

查看:98
本文介绍了Play 框架:无法加载 JNotify 本机库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 Windows 10 机器上启动 Play 项目时遇到问题(在 Win 7 上运行良好)

Having issues starting Play project on my Windows 10 machine (worked fine on Win 7)

当我执行激活器运行"时,我得到以下信息:

When I do "activator run" I get the following:

Error loading library, java.library.path=C:\Program Files\Java\jdk1.8.0_111\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\cygwin64\usr\local\bin;C:\cygwin64\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\Java\jdk1.8.0_111\bin;C:\Program Files\PostgreSQL\9.6\bin;C:\Program Files\Git\cmd;C:\dev\utils\activator-1.3.5-minimal;C:\Users\shuda\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Heroku\bin;.;C:\dev\projects\energywatch-portal-bk\target\native_libraries\64bits

Cannot load the JNotify native library (no jnotify_64bit in java.library.path)
Play will check file changes for each request, so expect degraded reloading performace.

--- (Running the application from SBT, auto-reloading is enabled) ---

[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000

(Server started, use Ctrl+D to stop and go back to the console...)

[success] Compiled in 1s

我尝试了很多方法都没有成功.我试过改变:

I've tried many things with no success. I've tried changing from:

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.2")

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.2")

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.2")

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.2")

然后我又收到一个错误:

and I get another error:

java.lang.NoClassDefFoundError: play/Project$
        at com.typesafe.sbt.SbtEchoPlay$.tracePlaySettings(SbtEchoPlay.scala:19)
        at com.typesafe.sbt.SbtEchoPlay$.echoPlaySettings$lzycompute(SbtEchoPlay.scala:16)
        at com.typesafe.sbt.SbtEchoPlay$.echoPlaySettings(SbtEchoPlay.scala:16)
...
Caused by: java.lang.ClassNotFoundException: play.Project$
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at com.typesafe.sbt.SbtEchoPlay$.tracePlaySettings(SbtEchoPlay.scala:19)
        at com.typesafe.sbt.SbtEchoPlay$.echoPlaySettings$lzycompute(SbtEchoPlay.scala:16)
        at com.typesafe.sbt.SbtEchoPlay$.echoPlaySettings(SbtEchoPlay.scala:16)
       ...

所以,这是我目前的环境设置(更改 sbt-plugin 导致第二个问题)

So, here's my environment setup currently (changing sbt-plugin causes 2nd issue)

scalaVersion :="2.10.3" -> 来自 build.sbt

scalaVersion := "2.10.3" -> from build.sbt

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.2") -> 来自 plugins.sbt

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.2") -> from plugins.sbt

sbt.version=0.13.1 -> 来自 build.properties

sbt.version=0.13.1 -> from build.properties

再说一次,我使用的是 Win 10(64 位)

Again, I'm on Win 10 (64bit)

这里真的需要一些帮助,卡住了几天.

Really need some assistance here, been stuck for a few days.

推荐答案

该消息意味着 Play 找不到 jnotify lib,因此它将使用内部进程来检查文件更改(即重新编译并重新启动应用程序时文件更改).它不应该阻止您使用该框架,但性能可能比使用 jnotify 更差.

That message means Play can't find the jnotify lib, so it will use an internal process to check for file changes (ie recompile and restart the app when a file changes). It should not stop you from using the framework, but the performance may be worst than with jnotify.

无论哪种方式,您都可以从 https://sourceforge.net/projects/jnotify/ 并安装它(只需将 jnotify_64bit.dll 复制到 C:\Program Files\Java\jdk1.8.0_111\bin),该消息应该消失了.

Either way, you can download JNotify from https://sourceforge.net/projects/jnotify/ and install it (just copy the jnotify_64bit.dll to C:\Program Files\Java\jdk1.8.0_111\bin), and that message should be gone.

这篇关于Play 框架:无法加载 JNotify 本机库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆