Skip to content

java.lang.java.lang.NoClassDefFoundError #296

Open
@nicknamexiaozui

Description

@nicknamexiaozui

The env

image
image
image
From a local installation ,run the code

import imagej
ij = imagej.init('G:\\Fiji.app')

image_url = 'https://imagej.net/images/clown.jpg'
jimage = ij.io().open(image_url)

image = ij.py.from_java(jimage)

ij.py.show(image, cmap='gray')

the result

D:\python_tool\.env\Scripts\python.exe D:\python_tool\de.py 
Traceback (most recent call last):
  File "ClassLoader.java", line 521, in java.lang.ClassLoader.loadClass
java.lang.java.lang.ClassNotFoundException: java.lang.ClassNotFoundException: net.imglib2.img.basictypelongaccess.unsafe.owning.OwningFloatUnsafe
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "org.jpype.manager.TypeManager.java", line -1, in org.jpype.manager.TypeManager.findClassByName
Exception: Java Exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "D:\python_tool\de.py", line 3, in <module>
    ij = imagej.init('G:\\Fiji.app')
  File "D:\python_tool\.env\lib\site-packages\imagej\__init__.py", line 1200, in init
    success = _create_jvm(ij_dir_or_version_or_endpoint, mode, add_legacy)
  File "D:\python_tool\.env\lib\site-packages\imagej\__init__.py", line 1424, in _create_jvm
    sj.start_jvm()
  File "D:\python_tool\.env\lib\site-packages\scyjava\_java.py", line 243, in start_jvm
    callback()
  File "D:\python_tool\.env\lib\site-packages\imglyb\util.py", line 26, in _java_setup
    Helpers = scyjava.jimport("net.imglib2.python.Helpers")
  File "D:\python_tool\.env\lib\site-packages\scyjava\_java.py", line 405, in jimport
    return jpype.JClass(class_name)
  File "D:\python_tool\.env\lib\site-packages\jpype\_jclass.py", line 99, in __new__
    return _jpype._getClass(jc)
java.lang.java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: net/imglib2/img/basictypelongaccess/unsafe/owning/OwningFloatUnsafe

So I don't have the ideal to fix it

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-supportNeed help to get things working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions