4

I want to use My Calculator app created in java On my PC How can I use that class file to install that calculator app on my PC?

akash
  • 22,664
  • 11
  • 59
  • 87
  • I suggest you look into using an IDE (Integrated Developing Environment), as it seems that you are compiling `.java` to `.class` by hand. – skiwi Mar 06 '14 at 11:17

3 Answers3

5

You can create a Runable-Jar-File: more about runable jar file

or create a bat-File: more about but file

Community
  • 1
  • 1
Dominik
  • 299
  • 6
  • 18
  • 2
    You have to choose a runable jar file. In eclipse go to package explorer and choose your project. In context menu take export then runable jar file. – Dominik Mar 06 '14 at 11:26
  • To verify please open your `.jar` file in `winrar` and open `MANIFEST.MF` in `META-INF` folder and check for defination should like `Main-Class: com.YourClass` – Sarz Mar 06 '14 at 11:29
1

If you want to convert your .jar file into .exe

It will also create installer package of application.

Gottlieb Notschnabel
  • 9,408
  • 18
  • 74
  • 116
Sarz
  • 1,970
  • 4
  • 23
  • 43
0

If you have builded your program correctly. You can make easy script that launch your application. MyCalculator.bat make it as new text document and save it like this.

YourPathToJavaExe/java.exe "Path/to/your/java/.class/MyCalculator.class"

Hope it works. Mine is this.

C:\Program Files\Java\jre6\bin\java.exe