Can't find clojure.main in clojurescript's script/repl on Windows

518 views
Skip to first unread message

Tamreen Khan

unread,
Jul 21, 2011, 5:45:46 PM7/21/11
to clo...@googlegroups.com
Hi everyone, I'm trying to get the repl for Clojurescript to start under Windows but keep running into the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: clojure/main
Caused by: java.lang.ClassNotFoundException: clojure.main
        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: clojure.main.  Program will exit.

I've tried both running the script under cygwin and putting the contents into a batch file and running it with cmd.exe (it shouldn't be a problem since script/repl just contains one command which starts the java runtime with a few options). I've even tried changing the forward slashes in the command to backslashes.

Also, I'm running these commands from the clojurescript root directory. Even though it probably won't affect it I've set CLOJURESCRIPT_HOME as well. Any ideas?

Devin Walters

unread,
Jul 21, 2011, 5:48:23 PM7/21/11
to clo...@googlegroups.com
Did you run script/bootstrap?

You need a clojure-1.3 jar in your clojurescript/lib directory.

> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com (mailto:clo...@googlegroups.com)
> Note that posts from new members are moderated - please be patient with your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com (mailto:clojure+u...@googlegroups.com)
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en


Tamreen Khan

unread,
Jul 21, 2011, 5:49:39 PM7/21/11
to clo...@googlegroups.com
Yes. It worked fine.

Tamreen Khan

unread,
Jul 21, 2011, 5:50:40 PM7/21/11
to clo...@googlegroups.com
Hmm, I have clojure.jar, but not clojure-1.3.jar in clojurescript/lib

Brenton

unread,
Jul 21, 2011, 6:49:08 PM7/21/11
to Clojure
That clojure.jar file is clojure 1.3.

Something is wrong with the classpath.

Here are a couple of things to try:

- when using a batch file the classpath must be delimited with
semicolons instead of colons
- try replacing lib/* with an explicit list everything that is in lib
- something like lib/clojure.jar;lib/goog.jar;lib/compiler.jar

Just some thoughts

Tamreen Khan

unread,
Jul 21, 2011, 7:17:31 PM7/21/11
to clo...@googlegroups.com
Changing colons to semicolons did it! I guess since the classpath is a string that's passed to Java it still treats it like it would any path on Windows, even though I'm using it through Cygwin.

Thanks again!

Troy Clevenger

unread,
Jul 21, 2011, 6:39:19 PM7/21/11
to Clojure

On Jul 21, 5:50 pm, Tamreen Khan <histor...@gmail.com> wrote:
For me, if I replaced the ":" in the classpath argument with ";" I was
able to get the repl working.
Reply all
Reply to author
Forward
0 new messages