无法运行standalone.bat文件

时间:2018-07-16 19:46:03

标签: java batch-file ubuntu java-ee jboss

我正在尝试在服务器上运行Java EE应用程序(使用JBoss社区版的wild fly)。我已经建立了一个.war文件(名为Project_war.war,位于wildfly/standalone/deployments中),现在我进入wildfly/bin并运行./standalone.bat,但是它给出了以下错误:

./standalone.bat: line 1: @echo: command not found 
./standalone.bat: line 2: rem: command not found 
./standalone.bat: line 3: rem: command not found 
./standalone.bat: line 4: rem: command not found
./standalone.bat: line 5: $'\r': command not found 
./standalone.bat: line 6: rem: command not found 
./standalone.bat: line 7: rem: command not found 
./standalone.bat: line 8: rem: command not found
./standalone.bat: line 9: $'\r': command not found 
./standalone.bat: line 10: @if: command not found 
./standalone.bat: line 11: $'setlocal\r': command not found 
./standalone.bat: line 12: $'\r': command not found 
./standalone.bat: line 13: rem: command not found
./standalone.bat: line 16: rem: command not found 
./standalone.bat: line 18: $'\r': command not found 
./standalone.bat: line 19: $'\r': command not found 
./standalone.bat: line 20: syntax error near unexpected token `(' '
./standalone.bat: line 20: `if NOT "x%DEBUG%" == "x" (

有什么建议吗? 附言我正在使用ubuntu

2 个答案:

答案 0 :(得分:1)

为什么要在Ubuntu上运行standalone.bat文件。尝试运行相应的<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div id="parent"> <div id="child"> <div id="grandchild">Grandchild</div> </div> </div>文件。那应该为您工作。

答案 1 :(得分:0)

希望你在 bin 目录中!只需运行此命令:)

> sh standalone.sh

奖励:

现在,以防万一它仍然没有运行:

  1. 返回 (cd ..) => 现在进入独立文件夹 (cd standalone)

  2. 进入配置文件夹 (cd configuration)

  3. 在这里您将看到一个 standalone.xml 文件

  4. 使用编辑器打开这个文件

  5. 在此文件中搜索“偏移量”

  6. 此处将 0 替换为 9:

    port-offset="${jboss.socket.binding.port-offset:9}">

  7. 现在回到 bin 文件夹后再次运行 sh standalone.sh 命令。


试试

http://localhost:8089

如果它运行,请投票:)