简体   繁体   English

Java-将项目导出到开源

[英]Java - Export Project to Open Source

I'm using eclipse to develop my Java program, and I was wondering if their is a way to export it as open source software. 我正在使用eclipse开发我的Java程序,我想知道他们是否是将其导出为开源软件的一种方法。 For example, KeePass developed using C#, allows you to download a zip file. 例如,使用C#开发的KeePass,允许您下载一个zip文件。 When you unzip it, you can double click the icon and start using the software, and still open and see the code. 解压缩后,可以双击图标并开始使用该软件,然后仍然打开并查看代码。 Is it possible to do that in Java with eclipse? 是否可以在Java中使用eclipse做到这一点?

Yes, you can do that. 是的,你可以这么做。 Click File --> Export... --> Java, JAR File or Runnable JAR file --> Next and then select option "Export Java source files and resources". 单击文件->导出...-> Java,JAR文件或可运行的JAR文件->下一步,然后选择选项“导出Java源文件和资源”。 This will create a JAR file that can be executed, but people interested can also browse the source code which will be included within. 这将创建一个可以执行的JAR文件,但是有兴趣的人也可以浏览将包含在其中的源代码。

You could take a look at websites such as SourceForge . 您可以看一下SourceForge等网站。 Through it you should be able to upload your source and make it available to thrid parties. 通过它,您应该能够上载源并将其提供给第三方。 Others include Google Code and GitHub . 其他包括Google CodeGitHub

EDIT: As per your comment, you would need to turn your JAR file into an executable JAR. 编辑:根据您的评论,您需要将JAR文件转换为可执行的JAR。 Please check this eclipse page to see how this can be achieved. 请检查月食页面以了解如何实现。

There's no such thing like "export as open source". 没有“导出为开源”之类的东西。 Publish you source code (look for a fitting license though), use a version control system like git , publish it to public repositories like github . 发布您的源代码(虽然要寻找合适的许可证),使用版本控制系统(如git ,并将其发布到公共存储库(如github) You can also ship your compiled binaries as a download through these public sites then. 然后,您还可以通过这些公共站点将编译后的二进制文件作为下载内容进行运送。

If you're just looking for an executable version of your program, your question is a bit off. 如果您只是在寻找程序的可执行版本,那么您的问题就有点错了。 It strongly depends on the technology you're working with and of course the language. 这在很大程度上取决于您使用的技术以及语言。 For a standard Java project you can find that option under File --> Export --> Java --> Runnable JAR File . 对于标准Java项目,您可以在File --> Export --> Java --> Runnable JAR File下找到该选项。 I'm sure there's a way to include the sources in the wizard, but the preferable way to open source your software is what I wrote first, since then you can socialize your project. 我敢肯定有一种方法可以在向导中包含源代码,但是开源软件的首选方法是我首先写的,因为这样您就可以使您的项目社交化。

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

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