python调用java的jar包报错127 30
最近在弄python需要调用到Java的jar包,按照网上的教程走,最后总是报错Nomatchingoverloadsfoundfor[initinfind.atnati...
最近在弄python需要调用到Java的jar包,按照网上的教程走,最后总是报错No matching overloads found for [init in find. at native\common\jp_method.cpp:127
Java:
package aes;
import com.sun.crypto.provider.SunJCE;
...
public class EncrypAES
{
private static String defaultKey = "........";
public static EncrypAES getInstance()
{...}
public EncrypAES(String keyvalue)
{...}
public String encrytor(String str)
throws InvalidKeyException, IllegalBlockSizeException, BadPaddingException
{...}
public String decryptor(String buff)
throws InvalidKeyException, IllegalBlockSizeException, BadPaddingException
{...}
public static void main(String[] args)
throws Exception
{...}
public static byte[] parseHexStr2Byte(String hexStr)
{...}
public static String parseByte2HexStr(byte[] buf)
{...}
}
Python:
from jpype import *
import os.path
jarpath = os.path.join(os.path.abspath('.'), 'F:/python/AWL/testFile/')
startJVM("C:/Java/jre1.8.0_191/bin/server/jvm.dll", "-ea", "-Djava.class.path=%s" % (jarpath + 'xmenEncrytor.jar'))
JDClass = JClass("aes.EncrypAES")
jd = JPackage("aes").EncrypAES()
jprint = java.lang.System.out.println
jprint(jd.encrytor("000000"))
shutdownJVM()
运行python时总是报错No matching overloads found for [init in find. at native\common\jp_method.cpp:127
各位大佬求解! 展开
Java:
package aes;
import com.sun.crypto.provider.SunJCE;
...
public class EncrypAES
{
private static String defaultKey = "........";
public static EncrypAES getInstance()
{...}
public EncrypAES(String keyvalue)
{...}
public String encrytor(String str)
throws InvalidKeyException, IllegalBlockSizeException, BadPaddingException
{...}
public String decryptor(String buff)
throws InvalidKeyException, IllegalBlockSizeException, BadPaddingException
{...}
public static void main(String[] args)
throws Exception
{...}
public static byte[] parseHexStr2Byte(String hexStr)
{...}
public static String parseByte2HexStr(byte[] buf)
{...}
}
Python:
from jpype import *
import os.path
jarpath = os.path.join(os.path.abspath('.'), 'F:/python/AWL/testFile/')
startJVM("C:/Java/jre1.8.0_191/bin/server/jvm.dll", "-ea", "-Djava.class.path=%s" % (jarpath + 'xmenEncrytor.jar'))
JDClass = JClass("aes.EncrypAES")
jd = JPackage("aes").EncrypAES()
jprint = java.lang.System.out.println
jprint(jd.encrytor("000000"))
shutdownJVM()
运行python时总是报错No matching overloads found for [init in find. at native\common\jp_method.cpp:127
各位大佬求解! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询