To avoid the installation of the application, i installed cygwin on my computer to easily test shell scripts, but there is a problem with the classpath format (explained here and here). As you can see in referenced posts cygwin provide an utility to solve this kind of problems (cygpath), so i came with a solution to execute my shell scripts without modify them.
First you have to write a shell script named java and placed it at the ~/bin directory:
#!/usr/bin/ksh
arguments=""
cpmod=0
for arg in $*
do
if [ $cpmod -eq 1 ] ; then
cp=`cygpath -wp ${arg}`
arguments="${arguments} ${cp}"
cpmod=0
else
if [[ $arg == "-cp" ]] || [[ $arg == "-classpath" ]] ; then
cpmod=1
fi
arguments="${arguments} ${arg}"
fi
done
java.exe ${arguments}
Finally you must set PATH variable enviroment to search first in your user bin directory. This can be easily done editing .bash_profile.
3 comments:
¿En inglés? :-(
Intentaré seguirlo....
No se si contare muchas cosas, pero la idea surge de problemas que me encuentro en informatica y solucionarlos, aunque esta abierto a cualquier cosa.
Muy buena idea, seguro que nos sirve a muchos :-)
Post a Comment