Thanks for the hint, Alexander. Removing the '@echo off' exposed the problem: it was apparently a local problem with my CLASSPATH environment variable:
[[[ C:\research\svnkit-1.7.0-alpha2\bin>echo %CLASSPATH% .;C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip ]]] (no idea how that came in there, probably some random tool I once installed. I suppose that's not set by the Java installer itself, because then other users would also run into this problem.) So the command executed by jsvn.bat became: [[[ C:\research\svnkit-1.7.0-alpha2\bin>java -Djava.util.logging.config.file="C:\research\svnkit-1.7.0-alpha2\bin\..\conf\logging.properties" -Dsun.io.useCanonCaches=false -classpath ;.;C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip;"C:\research\svnkit-1.7.0-alpha2\bin\..\lib\svnkit-1.7.0-alpha2.jar";... [snip] ]]] After clearing the CLASSPATH environment variable it worked. Maybe it's best for jsvn.bat (and the other .bat scripts) to ignore the CLASSPATH variable that's already set in the environment. Apparently that was the case with svnkit up to 1.3.5, but from 1.3.6 onwards it takes the CLASSPATH from the environment and appends jars to that. I quickly checked the corresponding shell scripts, and they don't seem to have the same problem. -- Johan On Fri, Jan 20, 2012 at 2:33 PM, Alexander Kitaev <[email protected]> wrote: > Hello Johan, > >> C:\research\svnkit-1.7.0-alpha2\bin>jsvn.bat --version -q >> Exception in thread "main" java.lang.NoClassDefFoundError: Files > > Usually, such an exception might be caused by the space in the > JAVA_HOME path ("C:\Program Files\...") in case command script does > not quote paths properly. However, I cannot reproduce this problem on > my computer with 1.7.0-alpha2 version of SVNKit and JAVA_HOME > containing space. > > Could you please check jsvn.bat, e.g. remove @echo off to see the full > command that starts java. Does it contain unquoted paths with spaces > in your case? > > Thanks! > > Alexander Kitaev, > TMate Software, > http://subgit.com/ - Svn to Git Migration! > http://svnkit.com/ - Java [Sub]Versioning Library! > http://hg4j.com/ - Java Mercurial Library! > http://sqljet.com/ - Java SQLite Library! > > > > On 20 January 2012 11:26, Johan Corveleyn <[email protected]> wrote: >> Hi, >> >> When tying to run 'jsvn.bat' from svnkit 1.7.0-alpha2 I always get the >> following exception: >> >> [[[ >> C:\research\svnkit-1.7.0-alpha2\bin>jsvn.bat --version -q >> Exception in thread "main" java.lang.NoClassDefFoundError: Files >> Caused by: java.lang.ClassNotFoundException: Files >> 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: Files. Program will exit. >> >> C:\research\svnkit-1.7.0-alpha2\bin>echo %JAVA_HOME% >> C:\Program Files (x86)\Java\jdk1.6.0_25 >> ]]] >> >> I get the same error with 1.3.6, 1.3.7 and 1.7.0-alpha1. >> >> However, with 1.3.5 it works: >> >> [[[ >> C:\research\svnkit-1.3.5.7406>jsvn --version -q >> 1.3.5 >> ]]] >> >> What could be the problem? Perhaps it has something to do with the >> change of directory structure in the release? With 1.3.5 both the jsvn >> scripts and the jars where in the same directory (the base directory >> of the package). As of 1.3.6 the scripts are in 'bin', and the jars in >> 'lib'. >> >> -- >> Johan >> >
