在 Java 应用程序中实现 Growl

发布于 2024-10-10 08:02:45 字数 342 浏览 0 评论 0原文

我希望我的 Java 应用程序发出咆哮通知。我的 IDE 是 Eclipse 和 Netbeans,我正在尝试在其中实现一个库(到目前为止还没有成功)。如何将库添加到我的项目中,然后从我自己的类中引用这些类?此外,我在哪里可以找到合适的图书馆?

提前致谢!

编辑:好的,现在我已经以某种方式设法实现了该库^^但是:以下命令失败:

System.loadLibrary("growl");

它返回以下错误:

消息:java.library.path 中没有咆哮

我该如何解决此问题?

I want my Java application to make a growl notification. My IDEs are Eclipse and Netbeans, and I am trying to implement a library in either (so far it worked it neither). How can I just add the library to my project and then reference the classes from within my own classes? Moreover, where can I find an appropriate library?

Thanks in advance!

EDIT: Ok, now I have somehow managed to implement the library ^^ However: the following command fails:

System.loadLibrary("growl");

It returns following error:

Message: no growl in java.library.path

How can I fix this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

情感失落者 2024-10-17 08:02:45

关于合适的图书馆你应该用谷歌搜索一下。我发现了这个(在 10.5 上进行了测试,所以可能需要一些调整): http://www.cocoaforge.com/viewtopic.php?f=6&t=17320

要将库添加到 Eclipse 中的项目中,请将其复制到项目文件夹中(这不是必需的,您可以可以将其复制到任何您想要的位置,也可以复制到 JDK 的扩展文件夹中),然后通过项目设置添加它:

  • 右键单击项目并选择 Properties
  • 转到 Java Build 来 打开项目属性路径选项
  • 转到并添加它

alt text

About an appropriate library you should just google it. I found this one (that is tested on 10.5 so maybe it will need some tweaks): http://www.cocoaforge.com/viewtopic.php?f=6&t=17320

To add the library to your project in Eclipse copy it into the project folder (this is not necessary, you could just copy it wherever you want, also in extension folder of the JDK) and then add it through the project settings:

  • open project properties by right clicking the project and choosing Properties
  • go to Java Build Path option
  • go to Libraries and add it

alt text

-小熊_ 2024-10-17 08:02:45

可以在 OS X 上的 Java 6 中使用 AppleScript 脚本引擎与 Growl 进行通信。这是博客文章 描述如何做到这一点。

It's possible to use AppleScript script engine in Java 6 on OS X to communicate with Growl. Here's a blog post describing how to do it.

_失温 2024-10-17 08:02:45

也许这个可以帮助你。

如果您的类打包在 JAR 文件中,就像第 3 方库一样,您应该能够将其放入项目 /lib 目录中,并使用 IDE 将其添加到 CLASSPATH 中。这应该是你所要做的全部(如果我正确理解你的问题)。

Maybe this can help you.

If your classes are packaged in a JAR file, just like a 3rd party library, you should be able to put it in your project /lib directory and add it to the CLASSPATH using the IDE. That should be all you have to do (if I understand your question correctly).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文