Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Run a Java Project on Linux Without Using IDE

Tags:

java

linux

ide

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?

Thanks

like image 278
fanchyna Avatar asked May 20 '13 20:05

fanchyna


People also ask

Can you run Java without an IDE?

The Java Code to be Built and Executed Two of the classes do not have main functions and the third class, Main. java does have a main function to allow demonstration of running the class without an IDE. The code listings for the three classes are shown next.

Can we run Java program in Linux?

JDK contains tools required for development and JRE(Java Runtime Environment) which contains all libraries and JVM(Java Virtual Machine) is required to execute the programs. JDK can be installed on different operating systems including Linux, windows, and macOS.


1 Answers

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.

like image 73
KyleM Avatar answered Oct 06 '22 21:10

KyleM