Fiji (ImageJ) cannot run any script : java.lang.NoClassDefFoundError
Question: I'm trying to run some python scripts on Fiji, but it seems it cannot run a
simple code such as: `print("something")`. It always throw this
`java.lang.NoClassDefFoundError`, and a weirder thing is that the error always
points at some random line (even if the line contains no contents, it always
picks a random number each time I start fiji and keeps pointing at that line).

I'm running this on my machine: Ubuntu 15.10 64 bit and my Java and fiji are
all up to date.

Here is the detailed error script:

    
    
    Started gamepad_socket.py at Tue Apr 19 15:03:16 CEST 2016
    [WARNING] Auto-imports are active, but deprecated.
    Traceback (most recent call last):
      File "/home/peterpark/cti/Tutorials/gamepad_socket.py", line 33, in <module>
    
    java.lang.NoClassDefFoundError: javax/vecmath/Point3f
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
        at java.lang.Class.privateGetPublicMethods(Class.java:2902)
        at java.lang.Class.getMethods(Class.java:1615)
        at org.python.core.PyJavaType.init(PyJavaType.java:273)
        at org.python.core.PyType.createType(PyType.java:1264)
        at org.python.core.PyType.addFromClass(PyType.java:1201)
        at org.python.core.PyType.fromClass(PyType.java:1291)
        at org.python.core.adapter.ClassicPyObjectAdapter$6.adapt(ClassicPyObjectAdapter.java:76)
        at org.python.core.adapter.ExtensiblePyObjectAdapter.adapt(ExtensiblePyObjectAdapter.java:44)
        at org.python.core.adapter.ClassicPyObjectAdapter.adapt(ClassicPyObjectAdapter.java:120)
        at org.python.core.Py.java2py(Py.java:1563)
        at org.python.core.PyJavaPackage.addClass(PyJavaPackage.java:89)
        at org.python.core.PyJavaPackage.__findattr_ex__(PyJavaPackage.java:138)
        at org.python.core.PyObject.__findattr__(PyObject.java:863)
        at org.python.core.imp.importFromAs(imp.java:1015)
        at org.python.core.imp.importFrom(imp.java:987)
        at org.python.pycode._pyx1.f$0(/home/peterpark/cti/Tutorials/gamepad_socket.py:124)
        at org.python.pycode._pyx1.call_function(/home/peterpark/cti/Tutorials/gamepad_socket.py)
        at org.python.core.PyTableCode.call(PyTableCode.java:165)
        at org.python.core.PyCode.call(PyCode.java:18)
        at org.python.core.Py.runCode(Py.java:1275)
        at org.scijava.plugins.scripting.jython.JythonScriptEngine.eval(JythonScriptEngine.java:76)
        at org.scijava.script.ScriptModule.run(ScriptModule.java:174)
        at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167)
        at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126)
        at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65)
        at org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.java:191)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.ClassNotFoundException: javax.vecmath.Point3f
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 32 more
    

Thanks for your help in advance.


Answer: This seems to be a [bug](https://github.com/scijava/scijava-ui-
swing/issues/20) in the deprecated auto-import functionality of the script
editor.

Try **disabling auto-imports** via _Edit > Auto-import (deprecated)_ in the
menu of the script editor.

