Introduction to Java deployment:
We learned more about Java Swing in our previous tutorial, in this tutorial, we will learn how to deploy a java project.
Once coding has been completed, you have to wrap all the files as a JAR file and that jar file can be deployed in any required machine. Check our interesting Java training series.
![Java Deployment]()

Here is a Video tutorial on Java Deployment:
To Create a Java JAR file
Right-click the project folder and select “export “option.
![Java JAR File - Export]()

Select the java folder and select the jar file inside the java folder.
![select jar file]()

Enter the File name and file location to save.
![Save the Jar file]()

Click on finish.
Now, you can get the jar file in the specified location.
To Run the JAR file
You can run the jar file from the command prompt/ terminal.
First, you need to go to the directory in which you have the jar file from the terminal/command prompt.
Then, type the below command and hit enter,
java –cp JarName mainclass_with_packagename
![Execute Java Deployment]()

Now, the program has been executed.
Conclusion
Java class files can be wrapped as a jar file and that can be executed in any machine.
In this tutorial, we learned how to build a jar file and execute it.
PREV Tutorial | NEXT Tutorial
Thanks for your feedback!
Recommended Reading
-
This Tutorial Explains What is a JAR File and How to Run and Open it in Windows, MAC, Linux using .JAR File Openers: You must have come across JAR files at some point while surfing the Internet and must have wondered about it, about what it is and what it…
-
A Complete Overview of Java Virtual Machine: Java Deployment was explained clearly in our last tutorial. Here, we will explore more about JVM. Java Virtual Machine - JVM is a software implementation of a machine. While downloading JDK, JVM also comes with that. JRE provides the run-time environment. There are…
-
This Tutorial Provides an Introduction to the Basics of Java Coding Language. We will Introduce Topics Such as Java Class, OOPS, Syntax, and Core Java Concepts: In our previous tutorials, we have discussed the characteristics and features of the Java language. We have also learned about Java applications. We got…
-
This Tutorial gives a Detailed Description of Java as a Platform and its Components i.e. JRE, JDK, Java Virtual Machine and Difference Between JRE vs JDK: Java has been described as a programming language as well as the platform. In our introductory tutorial, we already discussed that a platform is…