Error running groovy project - java

I am trying to run a groovy project in windows java rembrandt.bin.Rembrandt and i got the following error
Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/groovy/r
untime/BytecodeInterface8
at rembrandt.bin.Rembrandt.<init>(Rembrandt.groovy)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstru
ctor.java:77)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteN
oUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstru
ctor(CallSiteArray.java:52)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor
(AbstractCallSite.java:190)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor
(AbstractCallSite.java:198)
at rembrandt.bin.Rembrandt.main(Rembrandt.groovy:383)
Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.runtime.Bytecod
eInterface8
at java.net.URLClassLoader$1.run(Unknown Source)
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)
... 11 more
I am using java 8. the funny thing is that i tried to run in Linux and the program worked.In Linux i am running java 7, but already tried with java 7 in windows and nothing. I am using groovy 1.7.5 and this class( BytecodeInterface8) only appear in 1.8.0 i cant understand why this run fine in Linux and not in windows. Ty for your help

Related

Eclipse Java JNI error occures

I just started with programming Java.
I want to use Eclipse. I already installed latest JRE 8 and JDK. But when I want to run my "Hello World" problem I get the following error:
"Error: A JNI error has occured, please check your installation and try again."
After that a new error window appears:
"A Java Exception has occured."
Beside the console gives me following details:
`Exception in thread "main" java.lang.NoClassDefFoundError: [LString;
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.privateGetMethodRecursive(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: String
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)
... 7 more`
What installation do I have to check? Thank you!

jar file not working with Java8

We have a jar file, which was compiled with java 1.6, and it was working fine.
Last month system were upgraded with java 8.
and now the java code gives the following error -
F:\globaltl\ConcurDump>java -jar ConcurDumpProcessLatest.jar prod
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/c
ontext/ApplicationContext
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa
der.java:56)
Caused by: java.lang.ClassNotFoundException: org.springframework.context.Applica
tionContext
at java.net.URLClassLoader$1.run(Unknown Source)
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 java.lang.ClassLoader.loadClass(Unknown Source)
Is this issue because of the version upgrade?
The same jar used to work fine with older java version.

Lucene ClassNotFoundError when loading analyzer

I tried to run Lucene Indexer but it gives me the following error:
java.lang.NoClassDefFoundError: org/apache/lucene/analysis/Analyzer
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.privateGetMethodRecursive(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.analysis.Analyzer
at java.net.URLClassLoader$1.run(Unknown Source)
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)
... 7 more
Exception in thread "main"
I used compile command:
javac -classpath 'C:/Users/Daniel/desktop/Java WorkSpace/JavaPackage/lucene-3.0.0/lucene-core-3.0.0.jar' Indexer.java;
and it works.
But when I tried to execute the compiled class:
java Indexer;
It gives me the ClassNotFoundException(). PS: the compiled class file and jar file are not in the same folder. Would that matter?
Thanks!
The Lucene Analyzers are no longer in the Lucene core. Download the JAR (or add to your Maven dependencies) for the corresponding version here: http://mvnrepository.com/artifact/org.apache.lucene/lucene-analyzers

error in running java file

I am making a webapp using tomcat but its having problems in running in windows...there is a java file(thread.java) which runs another java file(emaildownload.java) so first I need to get to the directory in which class file is stored ...I am using
this.getClass().getClassLoader().getResource("").getPath();
for getting class path...and then I am running file by:
thread foo=new thread();
foo.runProcess("java mainclasses.emaildownload "+credentials[0]+" "+credentials[1]+" "+credentials[2]+" "+credentials[3]+" ");
file structure:
C:\Program Files\Apache Software Foundation\Tomcat 8.0\webapps\Mazil3.0\WEB-INF\classes\mainclasses\emaildownload.class
and mainclasses is package...
but I am getting this error:
java.lang.NoClassDefFoundError: javax/mail/UIDFolder
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: javax.mail.UIDFolder
at java.net.URLClassLoader$1.run(Unknown Source)
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)
... 6 more
I don't understand why the error is coming?
Interface UIDFolder belongs to javax.mail package since it is saying NoClassDefFoundError so you might not be having the javamail api in your classpath .Get it from here

Running Windows XP batch on Windows 7

I have a batch file which runs on XP:
#echo off
#setlocal
set CWD=%~dp0
set JYTHON_HOME=%CWD%
set LIB_DIR=%JYTHON_HOME%/lib
java -cp %LIB_DIR% -jar %LIB_DIR%/jython.jar -Djython.home=%CWD%
-Dpython.path=%LIB_DIR%;%CWD%/ext %LIB_DIR%clenotes/clenotes.py %*
#endlocal
I want to run this file on Windows 7.
EDIT:
When I run it this error occurs:
Exception in thread "main" java.lang.NoClassDefFoundError:
folder\CLENotes\lib Caused by: java.lang.ClassNotFoundException:
folder\CLENotes\lib
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)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Actually it is very simple, I needed to change the fowardslashes (/) to backslashes.

Categories

Resources