Sometimes the app can't be run successful

fiji
eclipse
Tags: #<Tag:0x00007fa30508f750> #<Tag:0x00007fa30508f5c0>

#1

The errors show like below:

[ECLIPSE HELPER] Indexing annotations...
���� 27, 2018 4:45:17 ���� java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
[ERROR] Cannot create plugin: class='target.classes.sc.fiji.app.FijiApp', name='Fiji', priority=0.0, enabled=true, pluginType=App
org.scijava.InstantiableException: Class not found: target.classes.sc.fiji.app.FijiApp
	at org.scijava.plugin.PluginInfo.loadClass(PluginInfo.java:291)
	at org.scijava.plugin.PluginInfo.createInstance(PluginInfo.java:300)
	at org.scijava.plugin.DefaultPluginService.createInstance(DefaultPluginService.java:237)
	at org.scijava.plugin.DefaultPluginService.createInstances(DefaultPluginService.java:226)
	at org.scijava.plugin.DefaultPluginService.createInstancesOfType(DefaultPluginService.java:217)
	at org.scijava.plugin.AbstractSingletonService.initInstances(AbstractSingletonService.java:93)
	at org.scijava.plugin.AbstractSingletonService.getInstances(AbstractSingletonService.java:76)
	at org.scijava.app.AppService.getApp(AppService.java:50)
	at org.scijava.script.DefaultScriptService.initScriptDirs(DefaultScriptService.java:292)
	at org.scijava.script.DefaultScriptService.scriptDirs(DefaultScriptService.java:249)
	at org.scijava.script.DefaultScriptService.getScriptDirectories(DefaultScriptService.java:130)
	at org.scijava.script.ScriptFinder.findScripts(ScriptFinder.java:105)
	at org.scijava.script.DefaultScriptService.initScripts(DefaultScriptService.java:319)
	at org.scijava.script.DefaultScriptService.scripts(DefaultScriptService.java:261)
	at org.scijava.script.DefaultScriptService.access$000(DefaultScriptService.java:79)
	at org.scijava.script.DefaultScriptService$1.get(DefaultScriptService.java:233)
	at org.scijava.object.ObjectIndex.resolvePending(ObjectIndex.java:388)
	at org.scijava.object.ObjectIndex.get(ObjectIndex.java:133)
	at org.scijava.object.ObjectIndex.getAll(ObjectIndex.java:122)
	at org.scijava.module.DefaultModuleService.getModules(DefaultModuleService.java:141)
	at net.imagej.legacy.LegacyService.initialize(LegacyService.java:495)
	at org.scijava.service.ServiceHelper.createServiceRecursively(ServiceHelper.java:354)
	at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:270)
	at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:232)
	at org.scijava.service.ServiceHelper.createServiceRecursively(ServiceHelper.java:341)
	at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:270)
	at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:232)
	at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:195)
	at org.scijava.service.ServiceHelper.loadServices(ServiceHelper.java:167)
	at org.scijava.Context.<init>(Context.java:280)
	at org.scijava.Context.<init>(Context.java:236)
	at org.scijava.Context.<init>(Context.java:176)
	at org.scijava.Context.<init>(Context.java:162)
	at net.imagej.ImageJ.<init>(ImageJ.java:77)
	at sc.fiji.Main.main(Main.java:50)
Caused by: java.lang.IllegalArgumentException: Cannot load class: target.classes.sc.fiji.app.FijiApp
	at org.scijava.util.ClassUtils.loadClass(ClassUtils.java:218)
	at org.scijava.plugin.PluginInfo.loadClass(PluginInfo.java:285)
	... 34 more
Caused by: java.lang.NoClassDefFoundError: target/classes/sc/fiji/app/FijiApp (wrong name: sc/fiji/app/FijiApp)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.scijava.util.ClassUtils.loadClass(ClassUtils.java:210)
	... 35 more
Exception in thread "main" java.lang.IllegalArgumentException: Invalid service: net.imagej.notebook.DefaultNotebookService
	at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:281)
	at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:232)
	at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:195)
	at org.scijava.service.ServiceHelper.loadServices(ServiceHelper.java:167)
	at org.scijava.Context.<init>(Context.java:280)
	at org.scijava.Context.<init>(Context.java:236)
	at org.scijava.Context.<init>(Context.java:176)
	at org.scijava.Context.<init>(Context.java:162)
	at net.imagej.ImageJ.<init>(ImageJ.java:77)
	at sc.fiji.Main.main(Main.java:50)
Caused by: java.lang.IllegalArgumentException: No compatible service: net.imagej.ops.OpService
	at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:244)
	at org.scijava.service.ServiceHelper.createServiceRecursively(ServiceHelper.java:341)
	at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:270)
	... 9 more

And what’s more, the error occurred sporadically.


#2

@frankgray Which IDE are you using? Did you follow the instructions to import your project as a Maven projects, as described on the wiki?