ninia / jep

Embed Python in Java
Other
1.3k stars 147 forks source link

java.lang.NoSuchMethodError: jep.Jep.set(Ljava/lang/String;Ljava/lang/String;)V #427

Closed wanran-cell closed 1 year ago

wanran-cell commented 1 year ago

Describe the problem The code failed to run at this line jep.set("trainedFolder", Normalizer.NEURALDATA_PREFIX + "\" + folderName + "\train\ckpt"); String base = Normalizer.NEURALDATA_PREFIX.replace("\", "\\"); Error:java.lang.NoSuchMethodError: jep.Jep.set(Ljava/lang/String;Ljava/lang/String;)V

Environment (please complete the following information):

bsteffensmeier commented 1 year ago

It looks like you are trying to run java code compiled with jep 3.9 using jep 4.0 at runtime. As indicated in the release notes for Jep 4.0 there are changes that make it incompatible with previous versions of jep so this will not work.

In this case the JVM is looking for a set method that is defined in Jep 3.9 but not present in Jep 4.0. If you recompile your java code the remaining set method should work with your existing code.

wanran-cell commented 1 year ago

Yes, when I used Jep 4.03 and recompiled the java code, it worked well. Thank you very much!