将 Windows Java 命令转换为 Linux Java 命令?

发布于 2024-10-07 08:11:09 字数 471 浏览 0 评论 0原文

我在 BAT 文件中有以下文本,因此我在 Windows 中进行 java 程序。我想知道如何在 Linux 中做到这一点。

文件 1:

"C:\Program Files (x86)\Java\jdk1.6.0_23\bin\javac.exe" -sourcepath src -classpath bin;deps\jml-1.0b3-full.jar;deps\mail.jar -d bin src/*.java

文件 2:

"C:\Program Files (x86)\Java\jdk1.6.0_23\bin\java.exe" -Xmx1536m -classpath bin;deps\jml-1.0b3-full.jar;deps\mail.jar HelloWorld

如果有人能将它们转换为 Linux 命令,我真的很感激。

谢谢:D

I have the following text in a BAT files so I java program in windows. I was wondering how you can do this in linux.

File 1:

"C:\Program Files (x86)\Java\jdk1.6.0_23\bin\javac.exe" -sourcepath src -classpath bin;deps\jml-1.0b3-full.jar;deps\mail.jar -d bin src/*.java

File 2:

"C:\Program Files (x86)\Java\jdk1.6.0_23\bin\java.exe" -Xmx1536m -classpath bin;deps\jml-1.0b3-full.jar;deps\mail.jar HelloWorld

Id really appreciate it if someone would convert those to linux commands.

Thanks :D

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

紅太極 2024-10-14 08:11:09
  • 去掉引号 - Linux 中的空格不是通常的做法,因此不需要将引号
  • 更改为 : 作为类路径分隔符
  • 将斜杠更改为 /< /code>
  • 文件 .sh

创建应该是的

  • get rid of the quotations - spaces in linux are not a usual practice, so the quotes are not needed
  • change ; to : as classpath separator
  • change slashes to /
  • make the file .sh

that should be it.

心在旅行 2024-10-14 08:11:09

javajavac 的选项在所有平台上都是相同的。唯一会改变的是文件路径,例如。 deps\mail.jar 可能会变成 deps/mail.jar;和类路径分隔符 :(冒号)而不是 ;(分号)。

The options to java and javac are the same on all platforms. The only things that will change are the file path, for eg. deps\mail.jar might become deps/mail.jar; and the classpath separator, : (colon) instead of ; (semicolon).

小霸王臭丫头 2024-10-14 08:11:09

检查 java SDK(java-1.6.0-openjdk-devel 或 Sun)是否存在,并在 PATH 中

which javac

添加相同的选项
javac-源路径..

check if java SDK (java-1.6.0-openjdk-devel or Sun) exists and in the PATH

which javac

Next put the same options
javac -sourcepath ..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文