I installed Maven3 on Win7 64Bit.
When I enter mvn in command prompt I get:
Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/classworlds/Launcher
Caused by: java.lang.ClassNotFoundException: org.codehaus.classworlds.Launcher
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: org.codehaus.classworlds.Launcher. Program will exit.
%JAVA-HOME% is an env variable.
%M2% is included in PATH
D:\Users\me>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.6.0_26
D:\Users\me>echo %M2%
C:\TOOLS\maven-3.0.4\bin
What I do on windows 7 and 8 is set "M2_HOME" to my Maven directory which looks like this:
M2_HOME=E:\dev\tools\apache-maven-3.0.4
and then I add bin to my "PATH" and it works great!
Path=E:\dev\tools\apache-maven-3.0.4\bin;
I think part of your problem is that you're setting "M2" and not "M2_HOME".
I think you have downloaded the Source File and Not BINARY. You might be seeing Folders Starting with Apache-*** .
Download Binary file which has following folder structure
Apache-Maven-3.3.9\bin+boot+conf+lib+licence....
Then set your
M2_HOME=E:\dev\tools\apache-maven-3.3.9
and
Path=E:\dev\tools\apache-maven-3.3.9\bin;
Hope this will work.
Related
Cannot run-app from intellij 14, I am using grails 2.5.0
run-app outside intellij works!!
Error
"C:\Program Files\Java\jdk1.8.0_45\bin\java" -Dgrails.home=C:\opt\grails-2.5.3 -Dbase.dir=C:\Projects\SIM "-Dtools.jar=C:\Program Files\Java\jdk1.8.0_45\lib\tools.jar" -Dgroovy.starter.conf=C:\opt\grails-2.5.3/conf/groovy-starter.conf -Djline.WindowsTerminal.directConsole=false -javaagent:C:\opt\grails-2.5.3\lib\org.springframework\springloaded\jars\springloaded-1.2.4.RELEASE.jar -noverify -Dspringloaded=profile=grails;cacheDir=. -Dgrails.project.fork.run.debugArgs=-Xrunjdwp:transport=dt_socket,server=n,suspend=n,address=1326 -Dgrails.project.fork.test.debugArgs=-Xrunjdwp:transport=dt_socket,server=n,suspend=n,address=1326 -classpath "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.4\lib\idea_rt.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.4\lib\util.jar" -Dfile.encoding=UTF-8 com.intellij.rt.execution.CommandLineWrapper C:\Users\shay\AppData\Local\Temp\classpath0.tmp org.codehaus.groovy.grails.cli.support.GrailsStarter --main org.codehaus.groovy.grails.cli.GrailsScriptRunner --conf C:\opt\grails-2.5.3/conf/groovy-starter.conf "run-app -plain-output"
java.lang.NoClassDefFoundError: org/springsource/loaded/ri/ReflectiveInterceptor
Error starting Grails: org/springsource/loaded/ri/ReflectiveInterceptor
at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:224)
at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:264)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1426)
at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:46)
Caused by: java.lang.ClassNotFoundException: org.springsource.loaded.ri.ReflectiveInterceptor
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 8 more
Process finished with exit code 1
Re-importing the project and changing to grails 2.5.3 fixed it.
In my case I could not change grails version due to project requirements.
When changed version from latest to jdk1.8.0_65 all became normal. So have a look if you did upgrade java or having latest one (8.0_111 in my case).
I have the same problem, I just click event log (in the button right angle) and click Configure Grails SDK select grails SDK and it start work.
HTML suite exception seen:
java.lang.RuntimeException: java.lang.RuntimeException: Firefox 3 could not be found in the path!
Please add the directory containing ''firefox.exe'' to your PATH environment
variable, or explicitly specify a path to Firefox 3 like this:
*firefox3 c:\blah\firefox.exe
at org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory.createBrowserLauncher(BrowserLauncherFactory.java:195)
at org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory.getBrowserLauncher(BrowserLauncherFactory.java:109)
at org.openqa.selenium.server.htmlrunner.HTMLLauncher.getBrowserLauncher(HTMLLauncher.java:79)
at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:139)
at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:198)
at org.openqa.selenium.server.SeleniumServer.runHtmlSuite(SeleniumServer.java:640)
at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:305)
at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:245)
at org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:96)
Caused by: java.lang.RuntimeException: Firefox 3 could not be found in the path!
Please add the directory containing ''firefox.exe'' to your PATH environment
variable, or explicitly specify a path to Firefox 3 like this:
*firefox3 c:\blah\firefox.exe
at org.openqa.selenium.browserlaunchers.locators.CombinedFirefoxLocator.findBrowserLocationOrFail(CombinedFirefoxLocator.java:49)
at org.openqa.selenium.server.browserlaunchers.BrowserInstallationCache.locateBrowserInstallation(BrowserInstallationCache.java:46)
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.<init>(FirefoxChromeLauncher.java:53)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory.createBrowserLauncher(BrowserLauncherFactory.java:184)
... 8 more
Publishing Selenium report...
ERROR: Publisher org.jvnet.hudson.plugins.seleniumhtmlreport.SeleniumHtmlReportPublisher aborted due to exception
java.lang.NullPointerException
at org.jvnet.hudson.plugins.seleniumhtmlreport.SeleniumHtmlReportPublisher.perform(SeleniumHtmlReportPublisher.java:79)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:772)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:736)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:685)
at hudson.model.Run.execute(Run.java:1757)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:234)
Finished: FAILURE
Firefox is installed in - C:\Program Files\Mozilla Firefox
I have added the path in the Environment variables "*firefox C:\Program Files (x86)\Mozilla Firefox\" without quotes..
Selenium version used - selenium-server-standalone-2.39.0.jar
Mozilla Firefox version - 30.0
OS - Windows 8.1
I'm have download a jena-2.6.4 zip to manage a triple store. In this zip there was lib directory with libraries, and jena-tdb-0.9.4.jar was amount them.
However while trying the simplest following code
import com.hp.hpl.jena.tdb.*;
...
String tdbFile = "/tmp/tdb";
Dataset dataset = TDBFactory.createDataset(tdbFile);
I have an error saying that TDBFactory is not found. even Explicit importation import com.hp.hpl.jena.tdb.TDBFactory doesn't work. The Class is not define.
Any idea about this ?
Edition
Here is the Error message return
Exception in thread "main" java.lang.NoClassDefFoundError: com/hp/hpl/jena/sparql/engine/main/StageGenBasicPattern
at com.hp.hpl.jena.tdb.TDB.wireIntoExecution(TDB.java:173)
at com.hp.hpl.jena.tdb.TDB.initWorker(TDB.java:157)
at com.hp.hpl.jena.tdb.TDB.<clinit>(TDB.java:137)
at com.hp.hpl.jena.tdb.TDBFactory.<clinit>(TDBFactory.java:85)
at test.JenaRepositoryManagement.initializeTheTDBRepository(JenaRepositoryManagement.java:88)
at test.views.Main.main(Main.java:102)
Caused by: java.lang.ClassNotFoundException: com.hp.hpl.jena.sparql.engine.main.StageGenBasicPattern
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 6 more
Your stacktrce doesn't say that it can't find TDBFactory. It says that it can't find
com.hp.hpl.jena.sparql.engine.main.StageGenBasicPattern.
It sounds like you need some more jars on your classpath. After you download the apache-jena bundle from Apache Jena Releases, put all the jars in the lib subdirectory on your classpath, not just the tdb jar.
Somehow my workspace is corrupted. When I try to run my app in the intellij IDEA I get the following error:
"C:\Program Files\Java\jdk1.7.0_40\bin\java" -Dgrails.home=C:\catalysts\sdks\grails\grails-2.2.4\grails-2.2.4 -Dbase.dir=C:\catalysts\src\mediacenter\mm-web "-Dtools.jar=C:\Program Files\Java\jdk1.7.0_40\lib\tools.jar" -Dgroovy.starter.conf=C:\catalysts\sdks\grails\grails-2.2.4\grails-2.2.4/conf/groovy-starter.conf -Xmx768M -Xms768M -XX:MaxPermSize=256m -XX:PermSize=256m -Djline.WindowsTerminal.directConsole=false -javaagent:C:\catalysts\sdks\grails\grails-2.2.4\grails-2.2.4\lib\org.springsource.springloaded\springloaded-core\jars\springloaded-core-1.1.3.jar -noverify -Dspringloaded=profile=grails -Didea.launcher.port=7535 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 12.1.4\bin" -classpath "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 12.1.4\lib\idea_rt.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 12.1.4\lib\util.jar" -Dfile.encoding=UTF-8 com.intellij.rt.execution.CommandLineWrapper C:\Users\Catalysts\AppData\Local\Temp\classpath4359768120270928639.tmp com.intellij.rt.execution.application.AppMain org.codehaus.groovy.grails.cli.support.GrailsStarter --main org.codehaus.groovy.grails.cli.GrailsScriptRunner --conf C:\catalysts\sdks\grails\grails-2.2.4\grails-2.2.4/conf/groovy-starter.conf run-app
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259)
at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:121)
Caused by: java.lang.NoClassDefFoundError: org/springsource/loaded/ri/ReflectiveInterceptor
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:113)
... 6 more
Caused by: java.lang.ClassNotFoundException: org.springsource.loaded.ri.ReflectiveInterceptor
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
Process finished with exit code 1
Test cases work fine, I also can start the app with run-app in the intellij console (CTRL+Alt+G).
I hope you might can help me.
delete folder ~/.grails/.slcache
I recently was getting the exact same error (latest versions at this time: IDEA 14/grails 2.4.4). After fighting with it for a bit I recalled being asked a question earlier (by IDEA) something about the classpath, which I just blindly answered yes to. Trying to find this setting led me to this question: What does the dynamic.classpath flag do? (IntelliJ project settings)
After editing my .iws file and setting dynamic classpath back to false the 'ClassNotFoundException: org.springsource.loaded.ri.ReflectiveInterceptor' went away.
IntelliJ Idea needs to be upgraded to the last version
Hi I am new to openTaps ERP development just a day before I started it.I have install a previously done project in my eclips.When I run it it gives me following error.I dont understand that error.
what should be done?
(I am using Postgresql database in it)
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:152)
at org.opentaps.foundation.infrastructure.Infrastructure.getSessionFactory(Infrastructure.java:120)
at org.opentaps.common.container.HibernateContainer.start(HibernateContainer.java:109)
at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:102)
at org.ofbiz.base.start.Start.startStartLoaders(Start.java:264)
at org.ofbiz.base.start.Start.startServer(Start.java:313)
at org.ofbiz.base.start.Start.start(Start.java:317)
at org.ofbiz.base.start.Start.main(Start.java:400)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 8 more
Anyone knows how to resolve it??
try to download http://www.slf4j.org/download.html and extract it to some folder, then add the jar file (slf4j-api-1.6.4.jar) to your project build path (http://www.cs.duke.edu/courses/cps004g/fall05/assign/final/addlibrary.html)
or http://www.wikihow.com/Add-JARs-to-Project-Build-Paths-in-Eclipse-%28Java%29
, if another exception appeared related to (slf4j) , try to add all jar files in the (slf4j-1.6.4) folder.
It seems that there is problem in Ehcache jar file or configuration.
ensure that (ehcache-1.6.1.jar) in the build classpath, if not, try to download ehcache-1.6.1.jar.zip from http://www.java2s.com/Code/Jar/e/Downloadehcache161jar.htm then extract it and add it to the build path. or download the last version from http://ehcache.org/downloads/catalog ,
It seems also that opentaps ERP uses the hibernate library that uses the ehcache cache provider , but you have to configure it properly based on the version of hibernate and ehcache as mentioned here (https://forum.hibernate.org/viewtopic.php?f=1&t=1003897&view=previous)
or
http://forums.terracotta.org/forums/posts/list/4932.page
or
http://www.bonitasoft.org/forum/viewtopic.php?id=4783