Pyimagej error when initializing

When I initialize pyimagej with a specific version (let’s say ‘2.1.0’) a Java error comes out:

>>> import imagej
>>> ij = imagej.init('2.1.0')

Then this error shows up:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/altair/anaconda3/envs/py37/lib/python3.7/site-packages/imagej/", line 214, in init
    WindowManager = JObject(_WindowManager)
  File "/home/altair/anaconda3/envs/py37/lib/python3.7/site-packages/jpype/", line 59, in __new__
    return _JObjectFactory(*args, **kwargs)
  File "/home/altair/anaconda3/envs/py37/lib/python3.7/site-packages/jpype/", line 111, in _JObjectFactory
    return tp._cast(v)
TypeError: Unable to cast 'type' to java type 'java.lang.Class'

Instead, when I initialize without specifying the version some warnings appear, mainly log4j, and an ERROR: cannot create pluguin.

log4j:WARN No appenders could be found for logger (org.bushe.swing.event.EventService).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See for more info.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.imagej.patcher.LegacyInjector (file:/home/altair/.jgo/net.imglib2/imglib2-imglyb/1.0.0+net.imagej-imagej-RELEASE+net.imagej-imagej-legacy-RELEASE/ij1-patcher-1.1.0.jar) to method java.lang.ClassLoader.findLoadedClass(java.lang.String)
WARNING: Please consider reporting this to the maintainers of net.imagej.patcher.LegacyInjector
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[ERROR] Cannot create plugin: class='org.scijava.plugins.scripting.javascript.JavaScriptScriptLanguage', name='JavaScript', priority=0.0, enabled=true, pluginType=ScriptLanguage

What are theses errors referencing to? Should I install/fix some package?