Do you want to execute code from .jar, or open it?
If open, then .jar file is the same format as .zip files and you can use zipfile module to manipulate it. Example:
def show_jar_classes(jar_file):
"""prints out .class files from jar_file"""
zf = zipfile.ZipFile(jar_file, 'r')
try:
lst = zf.infolist()
for zi in lst:
fn = zi.filename
if fn.endswith('.class'):
print(fn)
finally:
zf.close()
If you want to execute it then I prefer creating simple batch/shell script which execute java with some parameters like -Xmx and with environment settings required by application.