Skip to main content

Posts

Showing posts from 2011

How to remotly debug java program using Eclipse

Eclipse provides a facility to debug your java programs remotely. To demonstrate how you can remotely debug java programs remotely, I will do the following: Create a .bat file that calls the java program Configure the arguments to the JVM so that the JVM will be capable of being remotely debugged Configure Eclipse to connect to the remote JVM 1. Create a bat file calling the java program I create a java class given below: public class RemoteDebugDemo { public static void main(String[] args) { System.out.println("STEP 1"); System.out.println("STEP 2"); System.out.println("STEP 3"); System.out.println("STEP 4"); System.out.println("STEP 5"); System.out.println("STEP 6"); } } Now I wish to run this program in batch mode.So I write a file called RemoteDebugDemo.bat file with following content. java -jar RemoteDebugDemo.jar I create a jar file named RemoteDebugDe

How to create a jar file using eclipse in 3 easy steps

A jar file is a J ava AR chive file that contains many java .class files as well as other resource files in a compressed format. It is similar to a tar or zip format. Here are three simple steps with illustrations to create your jar file in Eclipse IDE. Step 1 : Create your java class(es) I have written a java class HelloWorld.java in Eclipse in a package called HelloWorld as shown below. Step 2 : Choose the export file format Now I want to put entire project in a jar file. Right-click on the package and select export. Now select under Java icon JAR as shown. Step 3 : Specify the jar file name and location I give the jar file name as C:\amol\HelloWorld.jar as shown I check 'Export generated class files and Resources' and 'compress the contents of jar file' checkboxes. Thats it. Now just click finish and your jar file will be created at the given location. CGTUXEU3CDMS