CPython 2.7 + Java
<p>My major program is written in Python 2.7 (on Mac) and need to leverage some function which is written in a Java 1.8, I think CPython cannot import Java library directly (different than Jython)?</p>

<p>If there is no solution to call Java from CPython, could I integrate in this way -- wrap the Java function into a Java command line application, Python 2.7 call this Java application (e.g. using <code>os.system</code>) by passing command line parameter as inputs, and retrieve its console output?</p>

<p>regards,
Lin</p>

<ul>
<li>If you have lot of dependcieis on Java/JVM, you can consider using <code>Jython</code>.</li>
<li>If you would like to develop a scalable/maintainable application, consider using microservices and keep Java and Python components separate.</li>
<li>If your call to Java is simple and it is easy to capture the output and failure, you can go ahead with this running the system command to invoke Java parts.</li>
</ul>

java python osx python-2.7 cpython