0

I want to use a Java project inside Python, I read that some Python libraries do it. But my question is it: If I do it, can I compile before all the code with pyinstaller or can I compile the java code in something like a dll to use inside the Python code, and use this before in the compiled program?

If somebody can reply, I have another doubt too, if don't have a way to do it with Java, have a way with another language, like PHP?

EDITED:

Send me to this question, but its out of date... I try to use the first answer, ikvm, but I receive this error because the version of java:

Warning IKVMC0108: not a class file "cc/mallet/util/tests/TestPriorityQueue$1.class", including it as resource (class format error "51.0")

source

DazzRick
  • 85
  • 7
  • The duplinks (taken together) should explain how to create a DLL from Java code that you can use from Python. But there are other ways to call Java code from Python that you may also want to research. – Stephen C Sep 02 '23 at 13:23
  • Really? What the another way that you recommend me? – DazzRick Sep 02 '23 at 15:02
  • Because I want a closed code, and I don't know if have a way to convert the two code together – DazzRick Sep 02 '23 at 15:03
  • *".... that you may also want to **research**."*. Google it. – Stephen C Sep 02 '23 at 15:27
  • Re: the "class format error 51.0" - Yes, one of duplinks specifically says that IKVM only supports Java 7 and earlier! (It is important to read Q&As carefully.) You could try recompiling your code with a Java 7 compiler, or the Java 8 compiler using the `-target 1.7` option. – Stephen C Sep 02 '23 at 15:35

0 Answers0