Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / June 2006

Tip: Looking for answers? Try searching our database.

NoClassDefFoundError: Files\groovy-1/0-jsr-05

Thread view: 
hawat.thufir@gmail.com - 23 Jun 2006 07:17 GMT
Regarding GROOVY_HOME environment variable:

I have JAVA_HOME set, and PATH set to use
";%JAVA_HOME%\bin;%GROOVY_HOME%\bin;" appended to the end (of PATH),
which, on the terminal, evaluates (?) out.  That's all well and good.

Do I have the right files for Groovy?  I think so, and I think I have
GROOVY_HOME and PATH to match those files.  Yes?

What's up with the forwards and backwards slashes in the error message
from the JVM?  There should only be backwards slashes in a windows
path, yes?

Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\>java -version
java version "1.5.0_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode, sharing)

C:\>groovy -version
Exception in thread "main" java.lang.NoClassDefFoundError:
Files\groovy-1/0-jsr-05
C:\>set
ALLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\Administrator\Application Data
CLASSPATH=%CLASSPATH%;.;
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=GEIDIPRIME
ComSpec=C:\WINNT\system32\cmd.exe
GROOVY_HOME=C:\Program Files\groovy-1.0-jsr-05
HOMEDRIVE=C:
HOMEPATH=\
JAVA_HOME=C:\Program Files\Java\jdk1.5.0_07
LOGONSERVER=\\GEIDIPRIME
NUMBER_OF_PROCESSORS=1
OS=Windows_NT
Os2LibPath=C:\WINNT\system32\os2\dll;
Path=C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program
Files\Java\jdk1.5.0_07\bin;C:\Program Files\groovy-1.0-jsr-05\bin;
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 3 Stepping 4, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0304
ProgramFiles=C:\Program Files
PROMPT=$P$G
SystemDrive=C:
SystemRoot=C:\WINNT
TEMP=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
TMP=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
USERDOMAIN=GEIDIPRIME
USERNAME=Administrator
USERPROFILE=C:\Documents and Settings\Administrator
windir=C:\WINNT

C:\>cd C:\Program Files\groovy-1.0-jsr-05

C:\Program Files\groovy-1.0-jsr-05>dir
Volume in drive C has no label.
Volume Serial Number is FCD2-42DE

Directory of C:\Program Files\groovy-1.0-jsr-05

06/22/2006  10:00p      <DIR>          .
06/22/2006  10:00p      <DIR>          ..
06/21/2006  12:44a      <DIR>          bin
06/21/2006  12:43a      <DIR>          conf
06/21/2006  12:44a      <DIR>          docs
06/21/2006  12:43a      <DIR>          embeddable
02/13/2006  11:48p           1,249,664 groovy-1.0-jsr-05.jar
06/21/2006  12:44a      <DIR>          lib
02/13/2006  11:48p               1,978 LICENSE.txt
              2 File(s)      1,251,642 bytes
              7 Dir(s)     862,437,376 bytes free

C:\Program Files\groovy-1.0-jsr-05>java -jar groovy-1.0-jsr-05.jar
Failed to load Main-Class manifest attribute from
groovy-1.0-jsr-05.jar

C:\Program Files\groovy-1.0-jsr-05>jar -xf groovy-1.0-jsr-05.jar
META-INF/MANIFEST.MF

C:\Program Files\groovy-1.0-jsr-05>type META-INF/MANIFEST.MF
The syntax of the command is incorrect.

C:\Program Files\groovy-1.0-jsr-05>dir
Volume in drive C has no label.
Volume Serial Number is FCD2-42DE

Directory of C:\Program Files\groovy-1.0-jsr-05

06/22/2006  10:02p      <DIR>          .
06/22/2006  10:02p      <DIR>          ..
06/21/2006  12:44a      <DIR>          bin
06/21/2006  12:43a      <DIR>          conf
06/21/2006  12:44a      <DIR>          docs
06/21/2006  12:43a      <DIR>          embeddable
02/13/2006  11:48p           1,249,664 groovy-1.0-jsr-05.jar
06/21/2006  12:44a      <DIR>          lib
02/13/2006  11:48p               1,978 LICENSE.txt
06/22/2006  10:02p      <DIR>          META-INF
              2 File(s)      1,251,642 bytes
              8 Dir(s)     862,437,376 bytes free

C:\Program Files\groovy-1.0-jsr-05>cd META-INF

C:\Program Files\groovy-1.0-jsr-05\META-INF>dir
Volume in drive C has no label.
Volume Serial Number is FCD2-42DE

Directory of C:\Program Files\groovy-1.0-jsr-05\META-INF

06/22/2006  10:02p      <DIR>          .
06/22/2006  10:02p      <DIR>          ..
06/22/2006  10:02p                 360 MANIFEST.MF
              1 File(s)            360 bytes
              2 Dir(s)     862,437,376 bytes free

C:\Program Files\groovy-1.0-jsr-05\META-INF>type MANIFEST.MF
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.5.3
Created-By: Apache Maven
Built-By: theo
Package:
Build-Jdk: 1.5.0_01
Extension-Name: groovy
Specification-Title: groovy: a powerful and dynamic scripting langu...
Specification-Vendor: The Codehaus
Implementation-Title:
Implementation-Vendor: The Codehaus
Implementation-Version: 1.0-jsr-05

C:\Program Files\groovy-1.0-jsr-05\META-INF>cd ..

C:\Program Files\groovy-1.0-jsr-05>dir
Volume in drive C has no label.
Volume Serial Number is FCD2-42DE

Directory of C:\Program Files\groovy-1.0-jsr-05

06/22/2006  10:02p      <DIR>          .
06/22/2006  10:02p      <DIR>          ..
06/21/2006  12:44a      <DIR>          bin
06/21/2006  12:43a      <DIR>          conf
06/21/2006  12:44a      <DIR>          docs
06/21/2006  12:43a      <DIR>          embeddable
02/13/2006  11:48p           1,249,664 groovy-1.0-jsr-05.jar
06/21/2006  12:44a      <DIR>          lib
02/13/2006  11:48p               1,978 LICENSE.txt
06/22/2006  10:02p      <DIR>          META-INF
              2 File(s)      1,251,642 bytes
              8 Dir(s)     862,437,376 bytes free

C:\Program Files\groovy-1.0-jsr-05>cd bin

C:\Program Files\groovy-1.0-jsr-05\bin>dir
Volume in drive C has no label.
Volume Serial Number is FCD2-42DE

Directory of C:\Program Files\groovy-1.0-jsr-05\bin

06/21/2006  12:44a      <DIR>          .
06/21/2006  12:44a      <DIR>          ..
02/13/2006  11:48p                 541 grok
02/13/2006  11:48p                 479 grok.bat
02/13/2006  11:48p                 690 groovy
02/13/2006  11:48p                 470 groovy.bat
02/13/2006  11:48p                 555 groovyc
02/13/2006  11:48p                 493 groovyc.bat
02/13/2006  11:48p                 528 groovyConsole
02/13/2006  11:48p                 466 groovyConsole.bat
02/13/2006  11:48p                 537 groovysh
02/13/2006  11:48p                 475 groovysh.bat
02/13/2006  11:48p               5,044 startGroovy
02/13/2006  11:48p               3,728 startGroovy.bat
             12 File(s)         14,006 bytes
              2 Dir(s)     862,437,376 bytes free

C:\Program Files\groovy-1.0-jsr-05\bin>groovy
Exception in thread "main" java.lang.NoClassDefFoundError:
Files\groovy-1/0-jsr-05
C:\Program Files\groovy-1.0-jsr-05\bin>
C:\Program Files\groovy-1.0-jsr-05\bin>
C:\Program Files\groovy-1.0-jsr-05\bin>
C:\Program Files\groovy-1.0-jsr-05\bin>

thanks,

Thufir
Mark Space - 23 Jun 2006 08:31 GMT
> C:\Program Files\groovy-1.0-jsr-05>java -jar groovy-1.0-jsr-05.jar
> Failed to load Main-Class manifest attribute from
> groovy-1.0-jsr-05.jar

But which one is the error that you are ultimately worried about?

Assume it's the one I quoted above, I'd have to see how you were
attempting to load this resource. Need source code!

Someone with more experience than I may be able to guess, but I think it
would help.
jcsnippets.atspace.com - 23 Jun 2006 16:24 GMT
> > C:\Program Files\groovy-1.0-jsr-05>java -jar groovy-1.0-jsr-05.jar
> > Failed to load Main-Class manifest attribute from
[quoted text clipped - 4 lines]
> Assume it's the one I quoted above, I'd have to see how you were
> attempting to load this resource. Need source code!

Thufir,

If it's the one Mark pointed out, you're missing a "manifest" or you are
missing the "main-class" attribute in the manifest file.

Either way, there is no way for java.exe to know which lass to execute.

To make sure that's the problem, open the .jar file with WinZip (a jar has
the same structure as a zip file, so no problems there), and look for a file
called manifest.mf - check the contents of this file (if it exists).

Best regards,

JayCee
--
http://jcsnippets.atspace.com/
a collection of source code, tips and tricks
hawat.thufir@gmail.com - 23 Jun 2006 18:00 GMT
[...]
> If it's the one Mark pointed out, you're missing a "manifest" or you are
> missing the "main-class" attribute in the manifest file.
[quoted text clipped - 4 lines]
> the same structure as a zip file, so no problems there), and look for a file
> called manifest.mf - check the contents of this file (if it exists).
[...]

It was late at night, be kind!  ;)

Pardon, here's a better description:

I want to run groovy (from windows).  For example, "groovy
build.groovy", stuff like that.

I have no particular interest in this jar nor its manifest, I was just
exploring around and found that to be an odd *secondary* problem.
That's just what I downloaded from the groovy.  I'm assuming that the
manifest is correct for whatever purpose the groovy developers put that
jar to (?).  Let's please put that jar file and its manifest on the
backburner.

I downloaded the groovy zip file:

'This document describes how to install a binary distribution of
Groovy.

The latest release of Groovy is groovy-jsr-05.'
<http://groovy.codehaus.org/Installing+Groovy>

<http://dist.codehaus.org/groovy/distributions/groovy-1.0-jsr-05.zip>
unzips, and I put the contents into "Program Files."

Only when groovy wasn't working did I look at the groovy jar file which
I downloaded.   I don't think that jar file nor its manifest have
anything to do with my difficulties, which I believe to be PATH
related.

That is, when I type "groovy" or "groovysh" or "groovy -version", etc,
I get an error about "NoClassDefFound," which I _interpret_ to mean my
environment variables are wrong.

However, as far as I can tell, the env var's are correct.  ?

Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\>java -version
java version "1.5.0_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode, sharing)

C:\>set
ALLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\Administrator\Application Data
CLASSPATH=%CLASSPATH%;.;
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=GEIDIPRIME
ComSpec=C:\WINNT\system32\cmd.exe
GROOVY_HOME=C:\Program Files\groovy-1.0-jsr-05
HOMEDRIVE=C:
HOMEPATH=\
JAVA_HOME=C:\Program Files\Java\jdk1.5.0_07
LOGONSERVER=\\GEIDIPRIME
NUMBER_OF_PROCESSORS=1
OS=Windows_NT
Os2LibPath=C:\WINNT\system32\os2\dll;
Path=C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program
Files\Java\jdk1.5.0_07\bin;C:\Program
Files\groovy-1.0-jsr-05\bin;C:\Program Files\groovy-1.0-jsr-05\lib;
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 3 Stepping 4, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0304
ProgramFiles=C:\Program Files
PROMPT=$P$G
SystemDrive=C:
SystemRoot=C:\WINNT
TEMP=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
TMP=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
USERDOMAIN=GEIDIPRIME
USERNAME=Administrator
USERPROFILE=C:\Documents and Settings\Administrator
windir=C:\WINNT

C:\>cd C:\Documents and Settings\Administrator\Desktop\groovy

C:\Documents and Settings\Administrator\Desktop\groovy>dir
Volume in drive C has no label.
Volume Serial Number is FCD2-42DE

Directory of C:\Documents and Settings\Administrator\Desktop\groovy

06/21/2006  12:55a      <DIR>          .
06/21/2006  12:55a      <DIR>          ..
06/19/2006  03:25p                 677 build.groovy
              1 File(s)            677 bytes
              2 Dir(s)     861,032,448 bytes free

C:\Documents and Settings\Administrator\Desktop\groovy>groovy
build.groovy
Exception in thread "main" java.lang.NoClassDefFoundError:
Files\groovy-1/0-jsr-05
C:\Documents and Settings\Administrator\Desktop\groovy>
C:\Documents and Settings\Administrator\Desktop\groovy>
C:\Documents and Settings\Administrator\Desktop\groovy>

-Thufir
hawat.thufir@gmail.com - 23 Jun 2006 18:05 GMT
hawat.thu...@gmail.com wrote:
[...]
> Pardon, here's a better description:
>
> I want to run groovy (from windows).  For example, "groovy
> build.groovy", stuff like that.
[...]

More, and perhaps better, data:

Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\>java -version
java version "1.5.0_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode, sharing)

C:\>cd C:\Documents and Settings\Administrator\Desktop\groovy

C:\Documents and Settings\Administrator\Desktop\groovy>dir
Volume in drive C has no label.
Volume Serial Number is FCD2-42DE

Directory of C:\Documents and Settings\Administrator\Desktop\groovy

06/21/2006  12:55a      <DIR>          .
06/21/2006  12:55a      <DIR>          ..
06/19/2006  03:25p                 677 build.groovy
              1 File(s)            677 bytes
              2 Dir(s)     861,036,544 bytes free

C:\Documents and Settings\Administrator\Desktop\groovy>type
build.groovy

*import* java.io.File
*class* Build {

 srcDir = "src"
 buildDir = "build"
 buildProdDir = buildDir + File.separator + "prod"
 vendorLibDir = "vendor" + File.separator + "lib"

 ant = *new* AntBuilder()

 *void* clean() {
   ant.delete(dir: buildDir)
 }

 *void* prepare() {
   clean()
   ant.mkdir(dir: buildProdDir)
 }

 *void* compile() {
   prepare()
   ant.javac(srcdir: srcDir,
             destdir: buildProdDir,
             classpath: projectClasspath())
 }
 String projectClasspath() {
   ant.path {
     fileset(dir: vendorLibDir) {
       include(name: "**/*.jar")
     }
   }
 }
}
*new* Build().compile()
C:\Documents and Settings\Administrator\Desktop\groovy>groovy
build.groovy
Exception in thread "main" java.lang.NoClassDefFoundError:
Files\groovy-1/0-jsr-05
C:\Documents and Settings\Administrator\Desktop\groovy>
C:\Documents and Settings\Administrator\Desktop\groovy>
C:\Documents and Settings\Administrator\Desktop\groovy>groovysh
Exception in thread "main" java.lang.NoClassDefFoundError:
Files\groovy-1/0-jsr-05
C:\Documents and Settings\Administrator\Desktop\groovy>
C:\Documents and Settings\Administrator\Desktop\groovy>
C:\Documents and Settings\Administrator\Desktop\groovy>groovyConsole
Exception in thread "main" java.lang.NoClassDefFoundError:
Files\groovy-1/0-jsr-05
C:\Documents and Settings\Administrator\Desktop\groovy>
C:\Documents and Settings\Administrator\Desktop\groovy>
C:\Documents and Settings\Administrator\Desktop\groovy>echo 'same error
for every groovy command'
'same error for every groovy command'

C:\Documents and Settings\Administrator\Desktop\groovy>echo 'why the
forward slash after "Files"?'
'why the forward slash after "Files"?'

C:\Documents and Settings\Administrator\Desktop\groovy>
C:\Documents and Settings\Administrator\Desktop\groovy>
C:\Documents and Settings\Administrator\Desktop\groovy>

thanks,

Thufir
hawat.thufir@gmail.com - 23 Jun 2006 18:18 GMT
from the groovy mailing list (my gmail account is overflowing):

'From: Guillaume Laforge <glaforge@...>
Subject: Re: maybe I don't get classworlds
Newsgroups: gmane.comp.lang.groovy.user
Date: 2005-04-11 19:33:40 GMT (1 year, 10 weeks, 2 days, 15 hours and
41 minutes ago)

Hello Andy,

On 4/11/05, Andrew Turley <andrew@...> wrote:
> Following the direction on the "Installing Groovy" page does not work
> with groovy-1.0-jsr-01.  If I follow the instructions and try to run
[quoted text clipped - 14 lines]
> typing "groovysh" at the command prompt.  Should I HAVE to do something
> else now, or does it sound like I've done something wrong?

I'm not sure what's the problem there... but, I have a little idea:
could you please check what's in your GROOVY_HOME/lib folder? Make
sure there are the right versions of the jars there. Ideally, you
should trash everything that's in your GROOVY_HOME folder and unzip
the binary distribution again, and everything should be fine again.

--
Guillaume Laforge
http://glaforge.free.fr/weblog/?catid=2'

<http://article.gmane.org/gmane.comp.lang.groovy.user/3847/match=groovy+home>

It's a similar error, apparently env var related. ?

-Thufir
hawat.thufir@gmail.com - 26 Jun 2006 07:38 GMT
Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\>groovysh
Lets get Groovy!
================
Version: 1.0-jsr-05 JVM: 1.5.0_07-b03
Type 'exit' to terminate the shell
Type 'help' for command help
Type 'go' to execute the statements

groovy> exit
C:\>set
ALLUSERSPROFILE=C:\Documents and Settings\All Users
ANT_HOME=C:\Program Files\apache-ant-1.6.5
APPDATA=C:\Documents and Settings\Administrator\Application Data
CLASSPATH=%CLASSPATH%;.;
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=GEIDIPRIME
ComSpec=C:\WINNT\system32\cmd.exe
GROOVY_HOME=C:\groovy-1.0-jsr-05
HOMEDRIVE=C:
HOMEPATH=\
JAVA_HOME=C:\Program Files\Java\jdk1.5.0_07
LOGONSERVER=\\GEIDIPRIME
NUMBER_OF_PROCESSORS=1
OS=Windows_NT
Os2LibPath=C:\WINNT\system32\os2\dll;
Path=C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program
Files\Java\jdk1.5.0_07\bin;C:\groovy-1.0-jsr-05\bin;C:\groovy-1.0-jsr-05\lib;C:\Program
Files\apache-ant-1.6.5\bin;
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 3 Stepping 4, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0304
ProgramFiles=C:\Program Files
PROMPT=$P$G
SystemDrive=C:
SystemRoot=C:\WINNT
TEMP=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
TMP=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
USERDOMAIN=GEIDIPRIME
USERNAME=Administrator
USERPROFILE=C:\Documents and Settings\Administrator
windir=C:\WINNT

C:\>

It's a bug with groovy. GROOVY_HOME doesn't work if there's a space in
the path as in, for example, Program Files.

-Thufir
jcsnippets.atspace.com - 26 Jun 2006 16:45 GMT
> [...]
<snipped>
> It was late at night, be kind!  ;)

Whoops... Just trying to help - anyway, I can see from your last post that
you've found the problem.

Best regards,

JayCee
--
http://jcsnippets.atspace.com/
a collection of source code, tips and tricks
hawat.thufir@gmail.com - 28 Jun 2006 05:55 GMT
> > [...]
> <snipped>
[quoted text clipped - 9 lines]
> http://jcsnippets.atspace.com/
> a collection of source code, tips and tricks

It's a bug in groovy setup.

I was trying to investigate the error, and, inadervedantly, supplied
too much data, obscuring what I perceived as the problem.  Sorry 'bout
that!

-Thufir


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.