Back Forum Reply New

Roo and cygwin

.uclClassLoader$1.run(Unknown Source)       at java.security.AccessController.doPrivileged(Native Method)       at java.net.uclClassLoader.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)       at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: org..roo.bootstrap.Bootstrap.  Program will exit.
Exception in thread quot;mainquot;

Anyone using roo in cygwin? It works fine in the normal windows xp command line.

I did a quick test a few months ago, finding it worked if I use quot;cygpathquot;. You can read a little more about using Java via Cygwin at cygwin/faq/. The main motivation I had for trying Cygwin was to see if the Roo shell services like colour would work better in Cygwin than they did in the native Windows shell, but sadly they didn't. They work just fine in *nix systems like Linux and Mac, but not in Windows.

If you edit the roo.bat to better support Cygwin whilst also supporting non-Cygwin Windows operations, please feel free to contribute back any changes via browse/ROO. We'd be happy to include the necessary improvements in future releases.

I followed Ben's link. I noticed that both JBoss and mvn support cygwin so I looked how they did it and then hacked roo.sh into submission.

Here is what I came up with.... (this roo.sh should work under Unix, Linux, MacOS and cygwin)...

roo.sh that is cygwin friendly...#!/bin/sh

PRG=quot;$0quot;

while [ -h quot;$PRGquot; ]; do   ls=`ls -ld quot;$PRGquot;`   link=`expr quot;$lsquot; : '.*-gt; \(.*\)$'`   if expr quot;$linkquot; : '/.*' gt; /dev/null; then       PRG=quot;$linkquot;   else       PRG=`dirname quot;$PRGquot;`/quot;$linkquot;   fi
done
ROO_HOME=`dirname quot;$PRGquot;`

# Absolute path
ROO_HOME=`cd quot;$ROO_HOME/..quot; ; pwd`

# echo Resolved ROO_HOME: $ROO_HOME
echo quot;ROO HOME $ROO_HOMEquot;
echo quot;JAVA_HOME $JAVA_HOMEquot;

cygwin=false;
case quot;`uname`quot; in   CYGWIN*)       cygwin=true       ;;
esac

if [ quot;$cygwinquot; = quot;truequot; ]; then
export ROO_HOME=quot;`cygpath -wp $ROO_HOME`quot;
export JAVA_HOME=quot;`cygpath -wp quot;$JAVA_HOMEquot;`quot;
export EXT_DIR=quot;quot;$ROO_HOME\\distquot;;quot;$ROO_HOME\\libquot;;quot;$ROO_  HOME\\workquot;;quot;$JAVA_HOME\\jre\\lib\\extquot;quot;
echo quot;ROO HOME $ROO_HOMEquot;
echo quot;JAVA_HOME $JAVA_HOMEquot;
echo quot;EXT_DIR $EXT_DIRquot;
else
export EXT_DIR=quot;$ROO_HOME/distROO_HOME/libROO_HOME/workJAVA_HOME/jre/lib/extquot;
fi

while true; do
java -Djava.ext.dirs=quot;$EXT_DIRquot; $ROO_OPTS -Droo.home=quot;$ROO_HOMEquot; org..roo.bootstrap.Bootstrap quot;classpath:roo-bootstrap.xmlquot; $@   EXITED=$?   # echo Exited with $EXITED   if [ $EXITED -ne 100 -a $EXITED -ne 200 ]; then
break
fi
done
browse/ROO-561 tracks Cygwin. Would you mind attaching it there?

Done. Thanks.

I tried this roo.sh under cygwin, but it doesn't work. I tried hint and it simply hangs. I have all the variables JAVA_HOME, ROO_HOME set properly.

--Irshad.

RE: I tried this roo.sh under cygwin, but it doesn't work. I tried hint and it simply hangs. I have all the variables JAVA_HOME, ROO_HOME set properly.

I successfully went through the tenminute walkthrough and created the initial starter application. The application ran fine with this roo.sh.

I was able to build and run tomcat. I was able to access the application from my web browser.

I don't think your issue is with the roo.sh file. I think you may have some other issue.

If roo.sh was not working, I would not expect roo to hang. I would expect you to get an error message like a class not found or command not found.

Thanks for attaching it. I'll send you the CLA separately so we're able to use the contrib.

Hi,

Thanks for the Cygwin support! Works for me except I had to add a line for Maven support:

export M2_HOME=quot;`cygpath -wp $M2_HOME`quot;

I installed roo this week.  I use Cygwin.  roo.sh almost works.  However,
perform package
fails, complaining about my JAVA_HOME.  Once I fixed that, it complained about M2_HOME.  So the current roo.sh needs

export JAVA_HOME=quot;`cygpath -wp quot;$JAVA_HOMEquot;`quot;
export M2_HOME=quot;`cygpath -wp quot;$M2_HOMEquot;`quot;

added to the 'if [ quot;$cygwinquot; = quot;truequot; ]; then', at which point, it will at least quot;perform packagequot; correctly.
¥
Back Forum Reply New