Skip to content

Commit

Permalink
Merge pull request #71 from davidlehrian/fix_jpy_import_location
Browse files Browse the repository at this point in the history
Move import of jpy until after the jvm is initlalized via jpyutil.init_jvm.
  • Loading branch information
jadsonbr authored Oct 29, 2020
2 parents d753c5e + c8e9857 commit 3faa324
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyreportjasper/jasperpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import tempfile
import jpyutil
import jpy
import json
from requests import Request, Session

Expand Down Expand Up @@ -52,7 +51,8 @@ def __init__(self, resource_dir=False, jvm_maxmem='512M', jvm_classpath=None):
jpyutil.init_jvm(jvm_maxmem=jvm_maxmem, jvm_classpath=[self.CLASSPATH])
else:
jpyutil.init_jvm(jvm_maxmem=jvm_maxmem, jvm_classpath=[self.CLASSPATH, jvm_classpath])

# import jpy here after init_jvm
import jpy
self.jvFile = jpy.get_type('java.io.File')
self.jvArrays = jpy.get_type('java.util.Arrays')
self.jvReport = jpy.get_type('de.cenote.jasperstarter.Report')
Expand Down

0 comments on commit 3faa324

Please sign in to comment.