Results 1 to 4 of 4
  1. #1
    arcticM is offline Member
    Join Date
    Aug 2009
    Posts
    2
    Rep Power
    0

    Default Running my prog.

    Hello everybody.:)
    I'm a beginner and I need your help.
    I have a GUI programme and I need to make it run from an icon on the desktop. can you help me with an easy way to do so?

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by arcticM View Post
    Hello everybody.:)
    I'm a beginner and I need your help.
    I have a GUI programme and I need to make it run from an icon on the desktop. can you help me with an easy way to do so?
    How you want to do that, I mean through a Java code? Or else you can make a jar file of your application and execute it, with a shortcut in Java launcher.

  3. #3
    arcticM is offline Member
    Join Date
    Aug 2009
    Posts
    2
    Rep Power
    0

    Default

    Quote Originally Posted by Eranga View Post
    How you want to do that, I mean through a Java code? Or else you can make a jar file of your application and execute it, with a shortcut in Java launcher.
    I tried doing it through jar file. but for some reason it doesn't work:confused:
    here's what I did-
    I created manifest.txt
    inside it says "Main-Class: MainGui
    "
    (MainGui is the name of my main class) and I put the txt file into the project folder.
    then I created jar file (I didn't understand any other way that was suggested on the web to do it ,so I went "File->export->jar file..etc) and I checked the box to include the manifest.txt
    but when I click on the jar file on my desktop I only hear an error sound! I guess I did something wrong.

    please I'm realy a beginner I need help!!:o

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Are you working on any IDE?

    First of all what you've to do is, create the jar file correctly. I believe that you've set of java class files which are working fine, no errors at all. So the next step is creating the manifest file. Open the command prompt and navigate ti your working folder. Then type the following command there.

    Java Code:
    C:\MyApplication>echo Main-Class: [I]YourMainClass[/I] >manifest.txt
    Then you've to bundle the all classes with that file, it's done by the following command.

    Java Code:
    C:\MyApplication>jar cvfm [I]JarFileName[/I].jar manifest.txt *.class
    Then test the jar file as follows.

    Java Code:
    C:\MyApplication>[I]JarFileName[/I].jar
    This is the easiest way to build the jar file for your application, just give a try and let me what's happen. Did you have any images in your applications, and any other resource files?

Similar Threads

  1. What I need to do more in this prog??
    By eliCanzee in forum AWT / Swing
    Replies: 2
    Last Post: 06-01-2009, 04:47 AM
  2. Running
    By AWPtic in forum Eclipse
    Replies: 1
    Last Post: 03-24-2009, 07:24 AM
  3. java annotations - small prog
    By sebo in forum New To Java
    Replies: 5
    Last Post: 10-24-2008, 06:48 AM
  4. Replies: 1
    Last Post: 07-13-2008, 04:16 PM
  5. need a prog on java 2d applet
    By bachelorswalk in forum Java Applets
    Replies: 0
    Last Post: 12-25-2007, 06:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •