如何在不使用IDE的情况下在Linux上运行Java项目 [英] How to Run a Java Project on Linux Without Using IDE

查看:148
本文介绍了如何在不使用IDE的情况下在Linux上运行Java项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Java新手。
基本上,我开发了一个java项目,其中包含Eclipse中的多个Java包。项目在安装了redhat Linux的桌面上运行正常。但是,我需要在没有安装X11的更强大的Linux服务器(redhat enterprise Linux)上运行它。因此,无法在该服务器上运行Eclipse。
有可能吗?如果是这样,我如何将整个项目移动到该服务器,包括输入和输出文件夹?

I am new to Java. Basically, I developed a java projects which contains multiple Java packages inside Eclipse. The project runs OK on my desktop with a redhat Linux installed. However, I need to run it on a more powerful Linux server (redhat enterprise Linux) which does not have X11 installed. Therefore, it is impossible to run Eclipse on that server. Is it possible to do that? If so, how can I move the entire project to that server including the input and output folders?

谢谢

推荐答案

在Eclipse中使用Export Runnable Jar选项。突出显示您的项目,然后单击文件 - >导出,选择Java,选择Runnable Jar文件。否则,您还可以使用 javac 编译器来编译项目,并使用java命令和主类运行它。

In Eclipse use the "Export Runnable Jar" option. Highlight your project then click file->Export, choose Java, choose Runnable Jar file. Otherwise you can also use the javac compiler to compile your project and run it with the java command and your main class.

这篇关于如何在不使用IDE的情况下在Linux上运行Java项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆