Problem with java classpath in Git Bash

2,348 views
Skip to first unread message

ka

unread,
Jun 30, 2010, 7:38:01 AM6/30/10
to msysGit
Hello,

Any idea on the following -

Welcome to Git (version 1.7.0.2-preview20100309)

$ java -cp lib/clojure-1.1.0.jar clojure.main
Clojure 1.1.0
user=>

$ java -cp lib/clojure-1.1.0.jar:lib/clojure-contrib-1.1.0.jar
clojure.main
Exception in thread "main" java.lang.NoClassDefFoundError: clojure/
main
Caused by: java.lang.ClassNotFoundException: clojure.main
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)
Could not find the main class: clojure.main. Program will exit.

Basically if I specify more than one jar in the -cp option (separated
by : colon), it doesn't work.

I couldn't find any search results on googling.

- Thanks

Johannes Schindelin

unread,
Jun 30, 2010, 7:48:34 AM6/30/10
to ka, msysGit
Hi,

Yep. On Windows, the path separator is a semicolon (';' instead of ':').
Don't ask why. Traditionally, the semicolon is interpreted by the Bash as
the command separator, so you'll have to escape it:

$ java -cp lib/clojure-1.1.0.jar\;lib/clojure-contrib-1.1.0.jar

If you wonder why it works with PATH: MSys has special handling routines
for that.

Ciao,
Johannes

ka

unread,
Jun 30, 2010, 8:07:15 AM6/30/10
to msysGit
Thanks a lot !

On a separated but related note, can Git Bash replace cygwin for my
common programming activities - is it designed with this intention?
Or should I use Git Bash only for Git related stuff ?

- Regards

Johannes Schindelin

unread,
Jun 30, 2010, 9:25:35 AM6/30/10
to ka, msysGit
Hi,

On Wed, 30 Jun 2010, ka wrote:

> Thanks a lot !

You're welcome!

But note: it should go without saying that sending a "Thanks" to an
anonymous mailing list is easy to be missed. Unless you are addressing
somebody who is only on that mailing list, and does not get any other
mail.

> On a separated but related note, can Git Bash replace cygwin for my
> common programming activities - is it designed with this intention? Or
> should I use Git Bash only for Git related stuff ?

It was the hope of the msysGit project's initiator (yours truly) that the
project would gain some traction, and many users would help the effort.
This has turned out not to be the case. A precious few people are
contributing to the project, so I decided to support only those.

Ergo: if you are contributing to msysGit, you can expect the project to
support your common workflows.

Otherwise, other people than me might want to help you, which could be
helped by you putting out some incentives.

Hth,
Johannes

ka

unread,
Jun 30, 2010, 10:30:40 AM6/30/10
to msysGit
@Johannes

> it should go without saying that sending a "Thanks" to an anonymous mailing list is easy to be missed.

You're quite right! Will keep that in mind from now on.

I am looking for unix like shells on windows machines, trying to
explore virtual machines, cygwin, power shell etc, and I stumbled onto
Git Bash :). Lets see how the exploration goes.

I'm sure the msysgit community is only going to increase as more and
more people take to Git. In any case, you and your team have done a
wonderful job with msysgit.

Regards.
Reply all
Reply to author
Forward
0 new messages