Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Java
Expertise: Beginner
Sep 10, 2001



Building the Right Environment to Support AI, Machine Learning and Deep Learning

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: <class name>

The .jar file can be created by passing:
Jar cfm   
<class file names>

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 <zipfile.zip> <Addional file names>
M.V. Prem
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date