windows classpath problem #541

Closed
netpyoung opened this Issue Apr 26, 2012 · 6 comments

3 participants

@netpyoung

C:\Documents and Settings\pyoung>echo %CLASSPATH%
C:\Program Files\Java\jre6\lib

C:\Documents and Settings\pyoung>lein
Exception in thread "main" java.lang.NoClassDefFoundError: Files\Java\jre6\lib;d:\myHome\clojure-home\/lein\self-installs\leiningen-2/0/0-preview3-standalone/jar

normally can't found exact path. so need to change lein.bat
-cp %CLASSPATH% ==> -cp "%CLASSPATH%" in :RUN_TRAMPOLINE, :RUN_NORMAL

@kondratovich kondratovich added a commit that referenced this issue Apr 30, 2012
@kondratovich kondratovich #541 d919f12
@technomancy
Owner

I'm going to drop support for setting the CLASSPATH variable entirely. It is only ever used by accident, and it causes nothing but trouble.

@technomancy
Owner

I believe this to be fixed in the latest master; feel free to reopen if there are issues.

@technomancy technomancy closed this May 7, 2012
@ath

I found the following:
Under Windows Server 2003 I get an error message:
“Fehler: Hauptklasse and konnte nicht gefunden oder geladen werden”
(Error: main class could not be found or loaded)

I echoed the path and found the following for :RUN_NORMAL:

"java" -client -Xbootclasspath/a:""
       -Dleiningen.original.pwd="C:\Documents and Settings\ath" 
       -cp ";"C:\Documents and Settings\ath\.lein\self-installs\leiningen-2.0.0-preview3-standalone.jar""
       clojure.main -m leiningen.core.main

but all this in a single row (I splitted this for readability).
Obviously we can see here a problem with the CP:
";"<somepath>\leiningen.jar""
The inner double quotes cause the error.
Under Windows 7 both versions do work
-cp %CLASSPATH% clojure.main -m leiningen.core.main %*
and
-cp "%CLASSPATH%" clojure.main -m leiningen.core.main %*

@technomancy
Owner

Does this mean the CLASSPATH variable itself has a quotation mark in it?

@ath

Yes, %CLASSPATH% gets replaced by "C:\Documents and Settings\ath\.lein\self-installs\leiningen.jar", including the double quotes. Windows 7 or Java 7 Update 4 is clever enough to understand double double-quotes too, but Windows Server 2003 or Java 7 (no Update) isn’t. But removing the double-quotes works under both systems.

The strange thing is that only recently those double-quotes were introduced to solve an issue, but to me it looks as if they only created a new one, and it is working fine without them.

@ath

I just saw ef11cb4#L0L27
I can’t test this right now, cause I have no W2003S here, but this might fix the issue.
It seesms at that point the double-quotes were introduced and should not be produced any longer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment