devxlogo

Executing a Java Application in an End User System

Executing a Java Application in an End User System

The Java 2 Runtime Environment is the minimum standard Java computing environment for running applications written in the Java programming language. It contains the Java virtual machine, Java core classes, and supporting files. It does not contain any of the development tools (such as applet viewer or javac) or classes that pertain only to a development environment. By default, the installer puts copies of the java and javaw in the Windows directory.

To execute a Java program in a end user system which does not have JDK installed, you should pack the .class files and other resources (like icons) in a .jar file. While creating your .jar file, you have to specify your application’s starting point (i.e. main method). The manifest file takes care of it and should contain following code:

 Main-Class: 

The .jar file can be created by passing:

 Jar cfm   

Just by clicking the .jar file, the java program can be executed. The end user system should have JRE installed. If you want, the .jar file can be zipped to contain additional files, such as the readme file, by passing:

 Jar cfM  
See also  Why ChatGPT Is So Important Today
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist