java UnsatisfiedLinkError awt.image

发布于 2024-08-24 17:15:08 字数 763 浏览 7 评论 0原文

我有一个程序,使用以下方法来获取图像图标的缩放实例:

public ImageIcon createScaledImageIcon(String filename) {
    ImageIcon icon = new ImageIcon(filename);
    Image image = icon.getImage().getScaledInstance(cardWidth, cardHeight, Image.SCALE_SMOOTH);
    icon.setImage(image);
    return icon;
}

我不知道这是否是问题的根源。但我收到以下错误消息:

线程“Image Fetcher 0”java.lang.UnsatisfiedLinkError 中出现异常:sun.awt.image.ImageRepresentation.setBytePixels(IIII[BIILsun/awt/image/ByteComponentRaster;I)V at sun.awt。 image.ImageRepresentation.setBytePixels(本机方法)

在 sun.awt.image.ImageRepresenation.setPixels(未知来源)

在 sun.awt.image.ImageDecoder.setPixels(未知来源)

在 sun.awt.image.GIFImageDecoder.sendPixels(未知来源 ) )...

如果我可以包含任何其他可能有用的信息,请告诉我。

I have a program that makes use of the following method to get a scaled instance of an image icon:

public ImageIcon createScaledImageIcon(String filename) {
    ImageIcon icon = new ImageIcon(filename);
    Image image = icon.getImage().getScaledInstance(cardWidth, cardHeight, Image.SCALE_SMOOTH);
    icon.setImage(image);
    return icon;
}

I don't know if it's the source of the problem or not. But i get the following error messages:

Exception in thread "Image Fetcher 0" java.lang.UnsatisfiedLinkError: sun.awt.image.ImageRepresentation.setBytePixels(IIII[BIILsun/awt/image/ByteComponentRaster;I)V at sun.awt.image.ImageRepresentation.setBytePixels(Native Method)

at sun.awt.image.ImageRepresenation.setPixels(Unknown Source)

at sun.awt.image.ImageDecoder.setPixels(Unknown Source)

at sun.awt.image.GIFImageDecoder.sendPixels(Unknown Source) ...

Let me know if there is any other information I could include that might be of use.

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

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

发布评论

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

评论(4

青芜 2024-08-31 17:15:08

尝试重新安装最新版本的 Java。您的安装可能不完整/损坏(请阅读类似体验 )。

Try reinstalling the latest version of Java. Your installation may have been incomplete/corrupt (read similar experience).

拥有 2024-08-31 17:15:08

此链接的用户表示此错误可能是由于收到 Java 响应并且不重新启动。不过,“重新启动”是指整个计算机还是只是重新启动 java 尚不清楚。

A user at this link suggests that this error may be the result of receiving a Java response and not rebooting. Whether "rebooting" referes to the entire computer, or just restarting java is unknown, though.

我在 Windows 机器上安装 Squirrel SQL 时遇到了同样的问题。原来是PATH的环境设置的原因。我已将 JAVA_HOME 设置为指向我安装的 Java 版本,但路径中还有另一个版本的 Java 早于我安装的版本(位于路径的末尾)。

所以我的 JAVA_HOME 设置不适合当您输入“java”时在命令行中实际运行的 Java 版本。

如果您看到此情况,您可以尝试确保您的 JAVA_HOME 环境变量指向您安装的 Java,并确保它首先出现在您的路径中。

I had this same problem with a Squirrel SQL install on a Windows machine. It turned out that the cause was the environment setting for the PATH. I had set JAVA_HOME to point to the Java version I installed, but there was another version of Java in the path earlier than the one I had installed (which was sitting at the end of the path).

So my JAVA_HOME setting was not right for the version of Java which was actually being run at the command line when you typed "java".

If you see this, you might try making sure that your JAVA_HOME environment variable points to the Java you installed and make sure that it appears first in your path.

缘字诀 2024-08-31 17:15:08

javadoc 说,如果 Java 虚拟机找不到声明为本机的方法的适当本机语言定义,则抛出该异常。

猜测 java 不知道如何读取您指定的图像。使用 .gif 格式。

javadoc says, Thrown if the Java Virtual Machine cannot find an appropriate native-language definition of a method declared native.

guess java does not know how to read the image u specified.. use a .gif format.

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