Results 1 to 4 of 4

Thread: Apache Maven Eroor - finding classworlds class

  1. #1
    Join Date
    Apr 2012
    Posts
    10

    Post Apache Maven Eroor - finding classworlds class

    Running Win 2008 Server, Eclipse Indigo, Latest version of Spring Framerwork. Trying the following example:

    http://viralpatel.net/blogs/2011/01/...hibernate.html

    Unfortunately it fails at the first step, when I try to execute any Maven command (ie: 'mvn -version'), I get the following error:

    C:\Users\SampleUser>mvn which
    Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/plexus/c
    lassworlds/launcher/Launcher
    Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.classworlds.lau
    ncher.Launcher
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 07)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 48)
    Could not find the main class: org.codehaus.plexus.classworlds.launcher.Launcher
    . Program will exit.

    I've tried setting MV2_HOME, deleted that, tried MV3_HOME, deleted that, tried MAVEN_HOME, deleted that. Checked my jdk, using:

    'java -version' ALL OK
    HOWEVER,

    'javac -version' returns the following error:

    C:\Users\SampleUse>javac -version
    'javac' is not recognized as an internal or external command,
    operable program or batch file.

    I wonder if that has anything to do with why Maven is not working? any suggestions on how to set up and use Maven correctly would be greatly appreciated. I checked a number of web resources most of which talk about the conflict in using more than one MVN home (ie: MV3_HOME when you already have MV2_HOME installed). This is not my case since I"m manually setting the homes from the command window and not through the Windows variables. Only my jdk is set from Windows. Any advice or suggestion is GREATLY appreciated. Many thanks, J

  2. #2
    Join Date
    Sep 2008
    Location
    Hamburg, Germany
    Posts
    1,650

    Default

    Hey!

    I thought the environment variable is called M2_HOME, but I am just guessing here that this might be related to your problem...

    -Martin
    Martin Lippert
    SpringSource, a division of VMware
    SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/martinlippert

  3. #3
    Join Date
    Apr 2012
    Posts
    10

    Default

    Hi Martin,

    I solved the problem. The environment var is called M2_HOME but that wasnt the problem. I basically downloaded and installed a 'stable' version and it works fine.

    Thanks anyway!

  4. #4
    Join Date
    Sep 2008
    Location
    Hamburg, Germany
    Posts
    1,650

    Default

    Hey!

    Thanks for letting us know and happy to hear that you got it working!!!

    -Martin
    Martin Lippert
    SpringSource, a division of VMware
    SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/martinlippert

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •