You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Oliver Schalch <ol...@wyona.com> on 2005/10/03 10:24:20 UTC

main method not found

Hiho List,

maybe someone can give me a hint, problem is (just on windows):

D:\workspace\wiki-parser>java -jar build\lib\WikiParser.jar
Exception in thread "main" java.lang.NoClassDefFoundError: 
org/wyona/wiki/Wiki2XML


The .jar is created with Maven and the interessting part looks like:

  30   <goal name="wikiparser:jar">
  31     <attainGoal name="wikiparser:compile"/>
  32     <mkdir dir="${lib.dir}"/>
  33     <jar destfile="${lib.dir}/WikiParser.jar" 
basedir="${classes.dir}" update="false">
  34       <manifest>
  35         <attribute name="class-path" value="${classpath.jar}"/>
  36         <attribute name="main-class" value="org.wyona.wiki.Wiki2XML"/>
  37       </manifest>
  38     </jar>
  39   </goal>


If you check the Manifest of the created .jar File the Mainclass is 
correct and also in the correct path/package. It works on Unix, not on 
Windows and I have really no idea what is going wrong, any hints where 
to look at I'd like.

Also, I think its not so good, that maven will create the repositority 
in users_home since on Windows its mostly c:\documents and 
settings\...\.maven, and the spaces are not good, but I doubt that this 
is relatied to my issue.

Thanks
Oliver



-- 
Oliver Schalch                           oliver.schalch@wyona.com
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org

Re: main method not found

Posted by Oliver Schalch <ol...@wyona.com>.
Oliver Schalch said the following on 03.10.2005 10:24:
> Hiho List,
> 
> maybe someone can give me a hint, problem is (just on windows):
> 
> D:\workspace\wiki-parser>java -jar build\lib\WikiParser.jar
> Exception in thread "main" java.lang.NoClassDefFoundError: 
> org/wyona/wiki/Wiki2XML
> 
Alright I found that there is a problem with the generated MANIFEST:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.5.3
Created-By: 1.4.2_08-b03 (Sun Microsystems Inc.)
class-path: C:\Documents and Settings\oli/.maven/repository/log4j/jars
  /log4j-1.2.9.jar
main-class: org.wyona.wiki.Wiki2XML

But, if I remove the WHOLE class-path. It will work on windows.
Changing the CP to something like: Class-Path: 
c:\tmp\.maven\repository\log4j\jars\log4j-1.2.9.jar didnt help.

How could I fix this with maven, so that I do not have to fix it 
manually? ;-)



-- 
Oliver Schalch                           oliver.schalch@wyona.com
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org