aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Strange error running Maven Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Strange error running Maven" Watch "Strange error running Maven" New topic
Author

Strange error running Maven

Alejandro Barrero
Ranch Hand

Joined: Aug 01, 2005
Posts: 311
I unziped the maven distribution, added bin to the path and created the variable MAVEN_HOME. I am running "mvn -version" but I get the error:
Error occurred during initialization of JVM
java/lang/NoClassDefFoundError: java/lang/object
Googling I found that this error can occur if java.exe has been copied to Window/System23. Unbelivable, it had happen; I deleted the file and other java files, but the problem persisted. I put the java bin at the beginning of the path to no avail; the problem is still there. It is not happening with other applications.

Your help will be greatly appreciated,

Alejandro Barrero


Your help will be greatly appreciated,
Alejandro Barrero
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30353
    
150

Try restarting DOS and then typing "java -version" and "path". Is it using the version/location that you want it to be?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Alejandro Barrero
Ranch Hand

Joined: Aug 01, 2005
Posts: 311
Thank you very much for your prompt reply. I have verified that "java -version" works and I have restarted DOS and rebooted my computer. I am using Java 7. Is there anything I can do in the configuration file?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

First, there is nothing wrong with java.exe being located in system32, the JRE installer places it there and it should not be causing a conflict (unless there is something else messed up on your system).

My suggestion is to reinstall the latest JDK (uninstall all JDKJs abnd JREs you have currently installed and download the latest JDK 7 from the Oracle web site). Once you have reinstalled it, make sure JAVA_HOME is set properly and that the JDK bin directory is in your path. The open a command prompt and run "java -version" and make sure you get a good result. Then try "mvn -version" again.


JBoss In Action
 
wood burning stoves
 
subject: Strange error running Maven