Skip to content
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

Exception NoClassDefFoundError for SourceCodeComponentFinderStrategy #53

Closed
jflalande opened this issue Sep 26, 2017 · 3 comments
Closed

Comments

@jflalande
Copy link

Hi
I am trying to use a ComponentFinder based on a SourceCodeComponentFinderStrategy:
ComponentFinder componentFinder = new ComponentFinder( forceCFI, "instru", new SourceCodeComponentFinderStrategy(new File(sourceRoot, "/src/"), 150)); componentFinder.findComponents();

but I get the following exception:
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/tools/javadoc/Main at com.structurizr.analysis.SourceCodeComponentFinderStrategy.runJavaDoc(SourceCodeComponentFinderStrategy.java:118) at com.structurizr.analysis.SourceCodeComponentFinderStrategy.afterFindComponents(SourceCodeComponentFinderStrategy.java:62) at com.structurizr.analysis.ComponentFinder.findComponents(ComponentFinder.java:76) at Test.main(Test.java:102) Caused by: java.lang.ClassNotFoundException: com.sun.tools.javadoc.Main at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 4 more

I tried to google search about the fail of the loading of the class but did not find anything usefull. I tried also to replace the OpenJDK by the Sun JDK but the error is still there. Is this a bug or I missed something ?

@simonbrowndotje
Copy link
Contributor

Assuming that you're not on Java 9 yet, I'm pretty sure you need the tools.jar file (JAVA_HOME/lib/tools.jar) on the classpath.

@jflalande
Copy link
Author

That's it (Java 8) ! Solved 👍
Thank you...

@simonbrowndotje
Copy link
Contributor

Thanks ... I've added a note to the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants