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

NoClassDefFoundError on jdk8 #242

Closed
appraveen opened this issue Aug 28, 2016 · 3 comments
Closed

NoClassDefFoundError on jdk8 #242

appraveen opened this issue Aug 28, 2016 · 3 comments

Comments

@appraveen
Copy link

Thank you for the plugin and this would really solve the problem of decorating the javadoc with ease. I am running in to this issue while trying to consume this plugin.

I have a simple maven Project with no dependencies.

Running the below command produces NoClassDefFoundError

javadoc -doclet ch.raffael.doclets.pegdown.PegdownDoclet -docletpath pegdown-doclet-1.3.jar

Stacktrace

java.lang.NoClassDefFoundError: org/parboiled/errors/ParserRuntimeException
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
    at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
    at java.lang.Class.getMethod0(Class.java:3018)
    at java.lang.Class.getMethod(Class.java:1784)
    at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:286)
    at com.sun.tools.javadoc.DocletInvoker.optionLength(DocletInvoker.java:213)
    at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:305)
    at com.sun.tools.javadoc.Start.begin(Start.java:219)
    at com.sun.tools.javadoc.Start.begin(Start.java:205)
    at com.sun.tools.javadoc.Main.execute(Main.java:64)
    at com.sun.tools.javadoc.Main.main(Main.java:54)
Caused by: java.lang.ClassNotFoundException: org.parboiled.errors.ParserRuntimeException

pom file

 <version>1.0-SNAPSHOT</version>
    <dependencies>
       <!-- Originally i did not have any dependenncies besides pegdown jar. These are added based on information provided on other sites/issues-->
        <dependency>
            <groupId>org.parboiled</groupId>
            <artifactId>parboiled-core</artifactId>
            <version>1.1.7</version>
        </dependency>
        <dependency>
            <groupId>org.parboiled</groupId>
            <artifactId>parboiled-java</artifactId>
            <version>1.1.7</version>
        </dependency>
        <dependency>
            <groupId>org.ow2.asm</groupId>
            <artifactId>asm-all</artifactId>
            <version>5.0.3</version>
        </dependency>
        <dependency>
            <groupId>ch.raffael.pegdown-doclet</groupId>
            <artifactId>pegdown-doclet</artifactId>
            <version>1.3</version>
        </dependency>
    </dependencies>
<build>
        <plugins>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9</version>
                <configuration>
                    <doclet>ch.raffael.doclets.pegdown.PegdownDoclet</doclet>
                    <docletArtifact>
                        <groupId>ch.raffael.pegdown-doclet</groupId>
                            <artifactId>pegdown-doclet</artifactId>
                        <version>1.3</version>
                    </docletArtifact>
                    <useStandardDocletOptions>true</useStandardDocletOptions>
                </configuration>
            </plugin>
</plugins>
</build>

Related Issues

#4
#62

Plugin

I installed IntelliJ Plugin, I guess this is only for preview inside IDE. Eventually I get the same error when I run

Tools -> Generate Javadoc -> Command line arguments with "-doclet ch.raffael.doclets.pegdown.PegdownDoclet -docletpath pegdown-doclet-1.3.jar"
@Abnaxos
Copy link

Abnaxos commented Aug 29, 2016

When running from the command line, you should use pegdown-doclet-1.3-all.jar. Maven adds the dependent JARs to the doclet path, but when running from the command line, you need to specify them manually. That's why there's a second JAR that already contains all dependencies, to make the command line shorter.

BTW, this is the wrong project. The doclet uses pegdown, but other than that, the two projects are completely unrelated. https://github.com/Abnaxos/pegdown-doclet is the right project.

@appraveen
Copy link
Author

appraveen commented Aug 30, 2016

Thank you @Abnaxos. '-all' was the issue. Now both javadoc and mvn works

mvn javadoc:javadoc 

@dengzun
Copy link

dengzun commented Apr 26, 2019

When running from the command line, you should use pegdown-doclet-1.3-all.jar. Maven adds the dependent JARs to the doclet path, but when running from the command line, you need to specify them manually. That's why there's a second JAR that already contains all dependencies, to make the command line shorter.

BTW, this is the wrong project. The doclet uses pegdown, but other than that, the two projects are completely unrelated. https://github.com/Abnaxos/pegdown-doclet is the right project.

Hi Abnaxos,
How could I build a new "-all" jar?

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

3 participants