简体   繁体   English

Eclipse Java Remote Project无法构建和运行

[英]Eclipse Java Remote Project won't build and run

I have spent 6h+ and finally I've decided to seek the community's help. 我花了6个小时以上的时间,最后我决定寻求社区的帮助。

I have a Java project on a remote SSH cluster and I have imported it into eclipse using RSE (Remote System Explorer). 我在远程SSH群集上有一个Java项目,并已使用RSE(远程系统资源管理器)将其导入eclipse。 This project used to be a local project and has many libraries/dependencies. 该项目曾经是本地项目,并且具有许多库/依赖项。 I have configured all of them and all of the paths are accessible on the remote cluster. 我已经配置了所有这些路径,并且所有路径都可以在远程集群上访问。

I want to run it on the remote cluster using SSH as well (via Eclipse External Tools). 我也想使用SSH(通过Eclipse External Tools)在远程集群上运行它。 I have configured EVERYTHING and have even successfully ran another project. 我已经配置了一切,甚至成功运行了另一个项目。 However, right now the problem is that Eclipse does not create even a SINGLE .class file on the remote server!!! 但是,现在的问题是,Eclipse甚至没有在远程服务器上创建SINGLE .class文件!

The project does not have any errors (if I just copy its bin folder from my computer to the remote cluster it works) but, since Eclipse does not produce a single .class file, there is nothing to run in its bin folder on the remote cluster. 该项目没有任何错误(如果我只是将其bin文件夹从我的计算机复制到它的远程集群中就可以使用),但是,由于Eclipse不会生成单个.class文件,因此远程上的bin文件夹中没有任何要运行的文件簇。
It's also worth mentioning that for some reason that I don't understand, there is a red x on the projects name in Project Exlorer (indicating error) but there is no such thing on any of the source codes/packages in this project. 还值得一提的是,由于某种原因,我不理解,Project Exlorer中的项目名称上有一个红色的x(指示错误),但是此项目中的任何源代码/软件包上都没有这样的东西。
The "Build Automatically" option is active and cleaning and building it manually won't work either. “自动构建”选项处于活动状态,手动清理和构建也不起作用。

Any help is hugely appreciated as I am really desperate and need to get this thing working. 非常感谢我的帮助,因为我真的很拼命,需要使这件事起作用。 Thanks in advance. 提前致谢。

I had a similar problem and this solution worked for me: In my java context.xml file in the META-INF folder (local project context), I added path="/myProjectName" and it started building automatically. 我有一个类似的问题,此解决方案对我有用:在META-INF文件夹(本地项目上下文)中的java context.xml文件中,我添加了path =“ / myProjectName”,它开始自动构建。

<Context path="/jvals" antiJARLocking="true" antiResourceLocking="true">
<Resource name="jdbc/jvals"....

I was never able to solve this problem and the only thing I could think of was a bug within Eclipse. 我从来没有能够解决这个问题,我唯一想到的就是Eclipse中的错误。 It seems that because of slow transfer rates to/from cluster, some of the files could not be built as they were partly fetched/stored. 似乎由于进/出群集的传输速度较慢,某些文件由于部分获取/存储而无法构建。 I ended up writing a shell script that would transfer the files to the remote cluster and compiled and ran it on there. 我最终编写了一个Shell脚本,该脚本会将文件传输到远程群集,然后在该群集上编译并运行它。

If anyone has a better suggestion, I will be very grateful. 如果有人有更好的建议,我将不胜感激。

I solve the problem in another way ; 我用另一种方式解决这个问题; go to the remote project in linux ; 转到linux中的远程项目;

cd youRemoteProject/build/classes if your jars is in xxx\\lib\\a.jar, b.jar cd youRemoteProject / build / classes,如果您的jar位于xxx \\ lib \\ a.jar,b.jar中

java -cp ".;xxx\\lib*" package.package.className java -cp“。; xxx \\ lib *” package.package.className

( you must using Java 6 or later, classpath wildcards are a part of the JVM ) (您必须使用Java 6或更高版本,类路径通配符是JVM的一部分)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM