Why am I on 1.8 0_ 45, Java Lang. nosuchmethoderror: createimageusingnativesize error
•
Java
In some cases, the code used to process a single image dragged and dropped from some webrowsers (Firefox) is in 1.8 0_ There are no problems in 25
image = (Image) trans.getTransferData("image/x-java-image;class=java.awt.Image");
But now it's 1.8 0_ 45 caused
java.lang.NoSuchMethodError: createImageUsingNativeSize at sun.lwawt.macosx.CDataTransferer.getImageForByteStream(Native Method) at sun.lwawt.macosx.CDataTransferer.platformImageBytesToImage(CDataTransferer.java:238) at sun.awt.datatransfer.DataTransferer.translateBytes(DataTransferer.java:1659) at sun.lwawt.macosx.CDataTransferer.translateBytes(CDataTransferer.java:142) at sun.awt.dnd.SunDropTargetContextPeer.getTransferData(SunDropTargetContextPeer.java:269) at sun.awt.datatransfer.TransferableProxy.getTransferData(TransferableProxy.java:73) at java.awt.dnd.DropTargetContext$TransferableProxy.getTransferData(DropTargetContext.java:376) at com.jthink.jaikoz.draganddrop.ImageHandler.createImageCell(ImageHandler.java:30)
Is this an error in the new version of OSX Java, or did I do something wrong? Is there a simple solution?
Paul
Solution
Downgrade to JDK 1.8 0_ He solved the problem for me
I call the following "jdk8" script with ". Jdk8"
version=1.8.0_31 export JAVA_HOME=$(/usr/libexec/java_home -v $version)
obtain
java -version java version "1.8.0_31" Java(TM) SE Runtime Environment (build 1.8.0_31-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07,mixed mode)
And error Java lang.NoSuchMethodError:1.8. 0_ The createimageusingnativesize error in 45 disappeared
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码