简体   繁体   English

如何在Eclipse中使用邮寄的.class文件

[英]How to use mailed .class files in eclipse

So a friend of mine told me I could mail my java projects to myself (the .class files) and then just put them into my workspace (yes I know about github, but having trouble with it, looking into it), though when I paste them into my workspace in the correct package, the code does not change. 所以我的一个朋友告诉我我可以将我的Java项目邮寄给我自己(.class文件),然后将它们放到我的工作区中(是的,我知道github,但是遇到麻烦,请仔细研究一下),尽管当我将它们粘贴到我的工作区中正确的包中,代码不会更改。

Even making an entire new package (which would be required since I mailed 2 projects, from which only one was on my primary computer) did not help, as the package remains empty. 甚至制作一个新的程序包(自从我邮寄2个项目(这在我的主计算机上只有一个项目以来,这都是必需的)之后才需要)也没有帮助,因为程序包仍然是空的。

Yes I've tried the import option, didn't work (yes I'm fairly new to eclipse) 是的,我尝试了导入选项,但没有用(是的,我是新来的蚀者)

Any help is appreciated 任何帮助表示赞赏

You can mail Java projects to yourself, but you want to send the source (.java) files to yourself. 可以将 Java项目邮寄给自己,但是想要将 (.java)文件发送给自己。 The .class files contain compiled byte-code and are generated from the source. .class文件包含已编译的字节码,并且是从源代码生成的。 Zip up the entire project folder and email it to yourself or place it on a thumb drive. 压缩整个项目文件夹并将其通过电子邮件发送给自己,或者将其放在拇指驱动器上。

The .class files are binary executables that are compiled from the .java files. .class文件是从.java文件编译的二进制可执行文件。 If you want to transfer an entire Eclipse project from one computer to another, you could zip the project from the top-level in your Eclipse workspace, email it, unzip it on the target computer, and then import it as an existing project into Eclipse. 如果要将整个Eclipse项目从一台计算机转移到另一台计算机,则可以从Eclipse工作区中的顶层压缩该项目,通过电子邮件发送它,将其解压缩到目标计算机上,然后将其作为现有项目导入到Eclipse中。 。 You can unzip it anywhere, but you might prefer to put the project into the Eclipse workspace on the target computer as a good convention. 您可以将其解压缩到任何位置,但您最好还是习惯将项目放入目标计算机上的Eclipse工作区中。

Note: I would recommend cleaning the project before zipping it so that you don't transfer the .class files that are going to be rebuilt anyway. 注:我会建议荏苒它,这样你就无法转移将要重建反正.class文件之前清理项目。 That will make the zip archive smaller. 这将使zip归档文件更小。

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

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