The company I work for uses Mac computers exclusively. While I like my Mac, it is only a 13″ laptop so I decided to setup my environment on my Windows pc as I have two 24″ monitors to work from. I want to be able to use devMode so I can update the UI without having to recompile everything. I was wondering if there is an easy way to convert a bash shell script into a windows batch file. Im not experienced at all in creating batch files so any help would be greatly appreciated
edit: I used Cygwin and I get the error:
$ ./devMode_osx.sh
Listening for transport dt_socket at address: 5006
Error: Could not find or load main class com.google.gwt.dev.DevMode
Here’s the file
#!/bin/sh
#
# Startup script for hosted mode.
# You have to add MAVEN_REPO to your variables; for example:
#
# export MAVEN_REPO="/Users/james/.m2/repository"
#
MAVEN_REPO="C:/Users/James/.m2/repository"
JAVA_HOME="C:/Program Files (x86)/Java/jdk1.6.0_38"
PATH=$JAVA_HOME/bin:$PATH
APPDIR=`dirname $0`;
BASE_JAVA_SRC="$APPDIR/../src/main/java"
BASE_JAVA_CLASSES="$APPDIR/../target/classes"
BASE_RESOURCES="$APPDIR/../src/main/webapp/"
DOMAIN_JAVA_SRC="$APPDIR/../../sample-domain/src/main/java"
DOMAIN_JAVA_CLASSES="$APPDIR/../../sample-domain/target/classes"
DOMAIN_JAVA_RESOURCES="$APPDIR/../../sample-domain/src/main/resources"
GWT_USER="$MAVEN_REPO/com/google/gwt/gwt-user/2.3.0/gwt-user-2.3.0.jar"
GWT_DEV="$MAVEN_REPO/com/google/gwt/gwt-dev/2.3.0/gwt-dev-2.3.0.jar"
JAVAX_VALIDATION="$MAVEN_REPO/javax/validation/validation-api/1.0.0.GA/validation-api- 1.0.0.GA.jar"
JAVAX_VALIDATION_SRC="$MAVEN_REPO/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA-sources.jar"
JVMARGS="-agentlib:jdwp=transport=dt_socket,address=5006,server=y,suspend=n"
#MP: run HostedMode with 'war' parameter set, as below, to specify, where the gwt output files are written to
#-war $BASE_RESOURCES
java $JVMARGS -XX:PermSize=256m -Xmx900M -Xms900M -cp "$BASE_JAVA_SRC:$BASE_JAVA_CLASSES:$BASE_RESOURCES:$GWT_USER:$GWT_DEV:$JAVAX_VALIDATION:$JA VAX_VALIDATION_SRC:$DOMAIN_JAVA_SRC:$DOMAIN_JAVA_CLASSES:$DOMAIN_JAVA_RESOURCES" \
com.google.gwt.dev.DevMode \
-startupUrl Sample.html com.ngcompliance.web.gwt.Sample\
-noserver -port 9999 -war $BASE_RESOURCES
Two approaches:
Use Cygwin (www.cygwin.com) to run a Bash shell script under Windows.
Take a basic batch programming tutorial.
Pay attention to the part of setting and accessing variables.
And then try to modify your bash script
Hint 1 setting variables
instead of
use
Hint 2 using variables
instead of
use
Hint 3 review use of external commands and SO idiosyncrasies
instead of
use