0

I've been using Cygwin on Windows for a POSIX environment.

When using the MALLET toolkit, however, I run into problems finding the classes. For example:

$bin/mallet import-file

Error: Could not find or load main class cc.mallet.classify.tui.Csv2Vectors

I tried wrapping the classpath in the bash script with `cygpath -pw $cp` but to no avail.

Peter O
  • 599
  • 1
  • 4
  • 18

1 Answers1

1

The problem is that java on Windows expects semi-colons, rather than colons.

Edit line 7 of /bin/mallet from:

cp=$malletdir/class:$malletdir/lib/mallet-deps.jar:$CLASSPATH

To:

cp="$malletdir/class;$malletdir/lib/mallet-deps.jar;$CLASSPATH"

Important: note that you now need to wrap the line in double-quotes, so that bash knows it is a string and doesn't end the command at the semi-colon.

Additionally, the paths need to be in UNIX style. To do this, change -classpath $cp on line 12 to -classpath `cygpath -pw $cp`.

Peter O
  • 599
  • 1
  • 4
  • 18