gpt4 book ai didi

java - 使用java环境将.sh文件转换为.bat文件

转载 作者:太空宇宙 更新时间:2023-11-04 05:01:43 24 4
gpt4 key购买 nike

我需要在 Windows 上运行这个 .sh linux bash 脚本,如何将其转换为批处理脚本?

这是我要转换的代码:

#!/bin/bash
LIB_PATH=./lib/antlr-2.7.6.jar:./lib/backport-util-concurrent-3.0.jar:./lib/commons-logging-1.1.1.jar:./lib/commons-codec-1.3.jar
LIB_PATH=$LIB_PATH:./lib/hibernate-annotations.jar:./lib/log4j-1.2.11.jar:./lib/asm-3.1.jar:./lib/c3p0-0.9.1.jar
LIB_PATH=$LIB_PATH:./lib/db.jar:./lib/:./lib/hibernate-commons-annotations.jar:./lib/mina-core-1.1.7.jar:./lib/commons-httpclient-3.1.jar:./lib/servlet-api-2.5-20081211.jar
LIB_PATH=$LIB_PATH:./lib/asm-analysis-3.1.jar:./lib/cglib-2.2.jar:./lib/dom4j-1.6.1.jar:./lib/javasoft-collection.jar:./lib/commons-primitives-1.0.jar
LIB_PATH=$LIB_PATH:./lib/mysql-connector-java-5.0.8-bin.jar:./lib/asm-commons-3.1.jar:./lib/commons-collections-3.2.jar:./lib/jetty-6.1.19.jar:./lib/jetty-util-6.1.19.jar
LIB_PATH=$LIB_PATH:./lib/editor.jar:./lib/javasoft-core.jar:./lib/commonnet.jar:./lib/asm-tree-3.1.jar:./lib/commons-configuration-1.5.jar
LIB_PATH=$LIB_PATH:./lib/ejb3-persistence.jar:./lib/jdom.jar:./lib/paradisevm.jar:./lib/asm-util-3.1.jar:./lib/commons-lang-2.3.jar:./lib/je-3.3.75.jar
LIB_PATH=$LIB_PATH:./lib/hibernate3.jar:./lib/jta.jar:./lib/slf4j-jdk14.jar:./lib/xerces-2.6.2.jar:./lib/xml-apis.jar:./lib/workshop.jar:./lib/commons-math-1.2.jar:./lib/ehcache-1.5.0.jar
LIB_PATH=$LIB_PATH:./lib/promptbubble_dep.jar
/usr/bin/java -server -Xms1024m -Xmx1024m -verbose:gc -XX:PermSize=128m -XX:MaxPermSize=128m -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+UseFastAccessorMethods -XX:CMSInitiatingOccupancyFraction=80 -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:+DisableExplicitGC -XX:MaxTenuringThreshold=31 -Djava.awt.headless=true -classpath "./lib/peony.jar:$CLASSPATH:.:$LIB_PATH" peony.game.Server $@>> stdout.log 2>&1 &
echo $! > world.pid
tail -f ./logs/world/world.log

最佳答案

echo off
set jar_lib=.\lib\antlr-2.7.6.jar;.\lib\backport-util-concurrent-3.0.jar;.\lib\commons-logging-1.1.1.jar;.\lib\commons-codec-1.3.jar
set jar_lib=%jar_lib%;.\lib\hibernate-annotations.jar;.\lib\log4j-1.2.11.jar;.\lib\asm-3.1.jar;.\lib\c3p0-0.9.1.jar
set jar_lib=%jar_lib%;.\lib\db.jar;.\lib\;.\lib\hibernate-commons-annotations.jar;.\lib\mina-core-1.1.7.jar;.\lib\commons-httpclient-3.1.jar;.\lib\servlet-api-2.5-20081211.jar
set jar_lib=%jar_lib%;.\lib\asm-analysis-3.1.jar;.\lib\cglib-2.2.jar;.\lib\dom4j-1.6.1.jar;.\lib\javasoft-collection.jar;.\lib\commons-primitives-1.0.jar
set jar_lib=%jar_lib%;.\lib\mysql-connector-java-5.0.8-bin.jar;.\lib\asm-commons-3.1.jar;.\lib\commons-collections-3.2.jar;.\lib\jetty-6.1.19.jar;.\lib\jetty-util-6.1.19.jar
set jar_lib=%jar_lib%;.\lib\editor.jar;.\lib\javasoft-core.jar;.\lib\commonnet.jar;.\lib\asm-tree-3.1.jar;.\lib\commons-configuration-1.5.jar
set jar_lib=%jar_lib%;.\lib\ejb3-persistence.jar;.\lib\jdom.jar;.\lib\paradisevm.jar;.\lib\asm-util-3.1.jar;.\lib\commons-lang-2.3.jar;.\lib\je-3.3.75.jar
set jar_lib=%jar_lib%;.\lib\hibernate3.jar;.\lib\jta.jar;.\lib\slf4j-jdk14.jar;.\lib\xerces-2.6.2.jar;.\lib\xml-apis.jar;.\lib\workshop.jar;.\lib\commons-math-1.2.jar;.\lib\ehcache-1.5.0.jar
set jar_lib=%jar_lib%;.\lib\promptbubble_dep.jar

java -server -Xms1024m -Xmx1024m -verbose:gc -XX:PermSize=128m -XX:MaxPermSize=128m -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+UseFastAccessorMethods -XX:CMSInitiatingOccupancyFraction=80 -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:+DisableExplicitGC -XX:MaxTenuringThreshold=15 -Djava.awt.headless=true -classpath %jar_lib%;peony.jar peony.game.Server
pause

关于java - 使用java环境将.sh文件转换为.bat文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30578708/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com