我工作的公司专门使用 Mac 电脑。虽然我喜欢我的 Mac,但它只是一台 13 英寸的笔记本电脑,所以我决定在我的 Windows 电脑上设置我的环境,因为我有两个 24 英寸的显示器可以工作。我希望能够使用 devMode,这样我就可以更新 UI 而无需重新编译所有内容。我想知道是否有一种简单的方法可以将 bash shell 脚本转换为 Windows 批处理文件。我在创建批处理文件方面完全没有经验,所以任何帮助将不胜感激
编辑:我使用了 Cygwin,我得到了错误:
$ ./devMode_osx.sh
Listening for transport dt_socket at address: 5006
Error: Could not find or load main class com.google.gwt.dev.DevMode
这是文件
#!/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