如何复制完美构建并运行到Visual Studio代码中的远程SSH服务器的Javafx代码?
我尝试在远程SSH服务器中复制Java项目文件夹。然后,我打开了Visual Studio代码,并使用Kelvin Schoofs使用SSH FS扩展名来打开远程文件夹。然后我打开了主.Java应用程序文件,然后按下“播放”按钮来编译和运行Java,但它行不通,它说:
$ cd /run/user/1000/gvfs/sftp:host=mynamesite.duckdns.org,port=9022/path/to/project ; /usr/bin/env /usr/lib/jvm/java-11-openjdk/bin/java @/tmp/cp_5b2xgbx2rjiw3h09vd2sbor51.argfile -m com.example/com.example.App
Error occurred during initialization of boot layer
java.lang.module.FindException: Module com.example not found
但是,即使我只是做Ctrl+Shift+Shift+P并进行全新的Javafx项目,交互式项目的创建失败并说:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.1.2:generate (default-cli) on project vipagepharma: Unable to add module to the current project as it is not of packaging type 'pom' -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
The terminal process "/usr/bin/bash '-c', 'mvn org.apache.maven.plugins:maven-archetype-plugin:3.1.2:generate -DarchetypeArtifactId="javafx-archetype-fxml" -DarchetypeGroupId="org.openjfx" -DarchetypeVersion="RELEASE" -DgroupId="com.example" -DartifactId="demo"'" terminated with exit code: 1.
I tried to copy the java project folder in remote ssh server. Then I opened Visual Studio Code and used SSH FS extension by Kelvin Schoofs to open the remote folder. Then I opened the main .java App file, and then I pressed "Play" button to compile and run java, but it does not work, it says:
$ cd /run/user/1000/gvfs/sftp:host=mynamesite.duckdns.org,port=9022/path/to/project ; /usr/bin/env /usr/lib/jvm/java-11-openjdk/bin/java @/tmp/cp_5b2xgbx2rjiw3h09vd2sbor51.argfile -m com.example/com.example.App
Error occurred during initialization of boot layer
java.lang.module.FindException: Module com.example not found
But even if I just do ctrl+shift+p and do a brand new JAVAFX project, the interactive project creation fails and says:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.1.2:generate (default-cli) on project vipagepharma: Unable to add module to the current project as it is not of packaging type 'pom' -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
The terminal process "/usr/bin/bash '-c', 'mvn org.apache.maven.plugins:maven-archetype-plugin:3.1.2:generate -DarchetypeArtifactId="javafx-archetype-fxml" -DarchetypeGroupId="org.openjfx" -DarchetypeVersion="RELEASE" -DgroupId="com.example" -DartifactId="demo"'" terminated with exit code: 1.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是我的一些建议:
首先,请确认您安装的JDK是否具有Javafx。
然后,您可以尝试使用
npm
来导入所有依赖关系并运行项目。或者,您可以通过切换到基于Maven的项目来简化整个过程。 Maven项目在名为pom.xml的文件中都具有所有构建和依赖性信息,并将简化所有其他依赖性问题。
这些步骤详细介绍了开始使用maven 开始Javafx 11。
最后,有一个vscode扩展名为 ant Target Runner 这可能会有所帮助你。
希望这对您有帮助。
Here are some of my suggestions:
First, please confirm whether the jdk you installed has JavaFX.
Then you can try to import all dependencies using
npm
and run the project.Or You can simplify this whole process by switching to Maven based projects. A maven project has all build and dependency information in a file called pom.xml and will simplify all other dependency issues.
The steps are detailed on Getting started with JavaFX 11 with maven.
Finally, there is a VSCode extension called Ant Target Runner that might help you.
Hope this helps you.