netbeans - java.lang.NoClassDefFoundError jar application -
i got maven project netbeans 8 (linux).
my project maven application have 'export' jar runnable java application. while i'm developing system in netbeans works fine maven dependencies, after compile , generate .jar file in target folder got error noclassdeffounderror. in searches through google found problem caused when have dependencies in development environment not when it's compiled classpath.
one solution include dependencies jar library in project, lost maven functionality. don't wanna make it, in last case.
how can solve problem without add dependencies library inside project?
thank much!
you not use correct maven plugin generate runnable jar, meaning jar dependencies within it. here how should like
<plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-assembly-plugin</artifactid> <version>2.4</version> <configuration> <finalname>.....</finalname> <outputdirectory>${basedir}</outputdirectory> <archive> <manifest> <mainclass>......</mainclass> </manifest> </archive> <descriptorrefs> <descriptorref>jar-with-dependencies</descriptorref> </descriptorrefs> </configuration> <executions> <execution> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> </plugins>
what have configured standard maven plugin generate jar file, without dependencies included.
Comments
Post a Comment