我是在与代码内部的Java项目一起编译和运行,但是如何将其编译并在其他机器中运行?

发布于 2025-01-29 04:26:15 字数 1675 浏览 3 评论 0 原文

我在VS代码中有这个组织: https://i.sstatic.net/ptclp.jpg.jpg 我只需单击“播放”按钮,该应用程序可以打开。 VS代码用于运行它的命令是:

$ cd "/home/allexj/Dropbox/ingegneria_del_software/Link to ing_del_softw/codice/VipagePharma/vipagepharma" ; /usr/bin/env /usr/lib/jvm/java-11-openjdk/bin/java @/tmp/cp_8o2vekaqsyood6mnlra3x7qpf.argfile -m com.vipagepharma/com.vipagepharma.App

未显示构建命令,因此我不知道VS代码是如何构建的,而我是新手,所以我的包装和编译内容有点差。

内部 /tmp/cp_8o2vekaqsyood6mnlra3x7qpf.argfile有:

-cp "/home/allexj/.m2/repository/org/openjfx/javafx-controls/13/javafx-controls-13.jar:/home/allexj/.m2/repository/org/openjfx/javafx-graphics/13/javafx-graphics-13.jar:/home/allexj/.m2/repository/org/openjfx/javafx-base/13/javafx-base-13.jar:/home/allexj/.m2/repository/org/openjfx/javafx-fxml/13/javafx-fxml-13.jar" --module-path "/home/allexj/Desktop/ing_del_softw/codice/VipagePharma/vipagepharma/target/classes:/home/allexj/.m2/repository/org/openjfx/javafx-controls/13/javafx-controls-13-linux.jar:/home/allexj/.m2/repository/org/openjfx/javafx-graphics/13/javafx-graphics-13-linux.jar:/home/allexj/.m2/repository/org/openjfx/javafx-base/13/javafx-base-13-linux.jar:/home/allexj/.m2/repository/org/openjfx/javafx-fxml/13/javafx-fxml-13-linux.jar"

如何在另一台计算机中构建和运行相同的代码?我不知道VS代码如何构建所有内容,因此我不知道如何以便携式方式进行操作。假设您克隆了此仓库: https://github.com/github.com/all3xj/all3xj/vipagepharma/vipagepharma/tree/main

,您必须构建&运行它。怎么做?

I have this organization inside VS Code: https://i.sstatic.net/ptClp.jpg
I just click on the "play" button and the app opens just fine. The command that VS Code use to run it is:

$ cd "/home/allexj/Dropbox/ingegneria_del_software/Link to ing_del_softw/codice/VipagePharma/vipagepharma" ; /usr/bin/env /usr/lib/jvm/java-11-openjdk/bin/java @/tmp/cp_8o2vekaqsyood6mnlra3x7qpf.argfile -m com.vipagepharma/com.vipagepharma.App

The build command is not showed, so I don't know how VS Code build it and I am newbie so I'm kinda poor in package and compiling stuff.

Inside /tmp/cp_8o2vekaqsyood6mnlra3x7qpf.argfile there is:

-cp "/home/allexj/.m2/repository/org/openjfx/javafx-controls/13/javafx-controls-13.jar:/home/allexj/.m2/repository/org/openjfx/javafx-graphics/13/javafx-graphics-13.jar:/home/allexj/.m2/repository/org/openjfx/javafx-base/13/javafx-base-13.jar:/home/allexj/.m2/repository/org/openjfx/javafx-fxml/13/javafx-fxml-13.jar" --module-path "/home/allexj/Desktop/ing_del_softw/codice/VipagePharma/vipagepharma/target/classes:/home/allexj/.m2/repository/org/openjfx/javafx-controls/13/javafx-controls-13-linux.jar:/home/allexj/.m2/repository/org/openjfx/javafx-graphics/13/javafx-graphics-13-linux.jar:/home/allexj/.m2/repository/org/openjfx/javafx-base/13/javafx-base-13-linux.jar:/home/allexj/.m2/repository/org/openjfx/javafx-fxml/13/javafx-fxml-13-linux.jar"

How can I build and run the same code in another machine? I don't know how VS Code has built everything, so I don't know how to do it in a portable way. Say you cloned this repo: https://github.com/All3xJ/VipagePharma/tree/main and you have to build&run it. How to do that?

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

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

发布评论

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

评论(2

薔薇婲 2025-02-05 04:26:15

您可以将项目转换为Maven项目,也可以使用 jar cf jar-file输入文件创建JAR文件,然后使用 java -jar -jar -jar< jar-file> 命令

指南>在Java

创建一个jar file

You can convert project to a Maven project or create a jar file using jar cf jar-file input-file(s) and then run jar file using java -jar <jar-file> command

Guide to Creating and Running a Jar File in Java

Creating a JAR File

孤独难免 2025-02-05 04:26:15

您可以从项目视图或运行命令 java:导出jar ....

您可以参考文档有关更多详细信息。

You can export your build to JAR from the projects view or by running the command Java: Export Jar....

You can refer to the document for more details.

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