Ben Chuanlong Du's Blog

And let it direct your passion with reason.

Build a Fat JAR Using Maven Without a Java Project

You can use Maven to download dependencies of Java packages without creating a Java project. For example, if you want to download all dependencies of arrow-jvm and arrow-memory and build everything into a single fat jar (for easy use in other places), you can first crate a file pom.xml …

Call Java Using PyJNIus from Python

PyJNIus is a simple-to-use Java interface for Python. However, JPype is a better alternative.

Installation

pip install Cython
pip install pyjnius

Example with Imported Jar

import os
os.environ["CLASSPATH"] = "/path/to/your.jar"
from jnius import autoclass
YourClass = autoclass(path.to.YourClass)
yourObj = YourClass()

Note: Avoid using the same …

Java Interfaces for Python

JPype, py4j and PyJNIus are all good options for Java interface for Python. Jpype is easy to use and widely adopted. PyJNIus is an even easier solution compred to JPype. py4j is more complicated to use compared to JPype and PyJNIus, however, it has a better performance, generally speaking.

JPype …

Parallel Computing Using Multithreading

  1. Not all jobs are suitable for parallel computing. The more comminication that threads has to make, the more dependent the jobs are and the less efficient the parallel computing is.

  2. Generally speaking, commercial softwares (Mathematica, MATLAB and Revolution R, etc.) have very good support on parallel computing.

Python

Please refer …