-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.java.lang.NoClassDefFoundError #296
Comments
Hi @nicknamexiaozui. Can you give me a little more information. What version of PyImageJ are you using? Can you run the PyImageJ doctor and post the output? See this page on how to use the |
The Definitely make sure you are running the newest PyImageJ version of course. As a workaround, you can download imglib2-unsafe-1.0.0.jar and place it into your Edit: Oh, from the screenshots above, I see your Maven is coming from |
@ctrueden wrote:
Thank you for you answer.I download the two jars ,and place it into your Now,it find another error |
@elevans Thank you, brother.After following the documentation, the following message is output
|
Hi @nicknamexiaozui. Thanks, the PyImageJ doctor says your environment has all the components it needs, but the output from @ctrueden 's suggestion indicates that have some version skew with some of the JARs in your environment. We're not exactly sure how this might have happened but there are few things you can do to help us figure this out:
import imagej
import scyjava as sj
def print_classpath():
System = sj.jimport('java.lang.System')
import re
classpath = re.split('[:;]', str(System.getProperty('java.class.path')))
print("\n".join(classpath))
sj.when_jvm_starts(print_classpath)
ij = imagej.init('/path/to/fiji')
|
@elevans i have no classpath,because my java version just has those files |
@nicknamexiaozui Please try adding the code that @elevans gave you to your Python program. Specifically: import scyjava as sj
def print_classpath():
System = sj.jimport('java.lang.System')
import re
classpath = re.split('[:;]', str(System.getProperty('java.class.path')))
print("\n".join(classpath))
sj.when_jvm_starts(print_classpath) Put this block of code just prior to your |
@nicknamexiaozui Are you trying to run this in the Spyder IDE by any chance? This looks like it. I remember working with someone who was trying to use PyImageJ with the REPL inside Spyder and for some reasons that I don't understand it didn't work. Instead using the command prompt/terminal worked as intended. Can you try to initialize PyImageJ outside of the IDE, perhaps in a jupyter notebook? EDIT: I checked if my memory was right on using |
@nicknamexiaozui Ahh, it seems that we didn't get the classpath printout because there are other
Of course, this is un-Pythonic, but it's only temporary for debugging purposes. Hopefully with the code structured this way, we'll see the classpath printout before the crash with Also, please observe carefully the exact final error message. The Either way, I'm not sure how the situation is happening. It's not supposed to be necessary to download and copy thef imglib2-imglyb + imglib2-unsafe JARs into your local Fiji—rather, what is supposed to happen is that PyImageJ downloads them on demand using the jgo library and mixes them into your classpath. But there might be a bug where that isn't happening. If so, it would explain the "class not found" error. But then in that case, I don't understand why you would be getting the "no attribute 'toNativeBool'" error after that... unless you somehow dropped in imglib2-imglyb-1.0.0.jar to your Fiji.app rather than imglib2-imglyb-2.0.0.jar? |
Hi @nicknamexiaozui, I'm just following up with you to see if you had a chance to try out @ctrueden suggested change to print out the classpath to help figure out whats going on your end. Did it work? |
The env
From a local installation ,run the code
the result
So I don't have the ideal to fix it
The text was updated successfully, but these errors were encountered: