Results 1 to 4 of 4
  1. #1
    orbutbul is offline Member
    Join Date
    Feb 2013
    Posts
    2
    Rep Power
    0

    Default Unable to create working JAR

    Hi
    So I'm pretty new to java, working with Bluej.
    I'm trying to create a program that does certain calculations to the amount of tips at a restaurant.
    It's very simple:

    import java.util.*;
    public class TIPIM
    {
    static Scanner reader = new Scanner(System.in);
    public static void main(String[]args)
    {
    double Hours = 0;
    System.out.println("הכנס טיפ");
    double Alltip = reader.nextInt();
    double Hafrasha = Alltip*0.05;
    System.out.println("הכנס מספר עובדים במשמרת");
    int Ovdim = reader.nextInt();
    System.out.println("הכנס כמות שעות של" + Ovdim + "עובדים");
    while (Ovdim!=0)
    {
    Hours = Hours+reader.nextDouble();
    Ovdim--;
    }
    System.out.println("כמה נותנים לאנג'לה?");
    int Answer = reader.nextInt();
    System.out.println("שעות בסך הכל: " + Hours);
    System.out.println(" משכורת לשעה:" + ((Alltip-Hafrasha)/Hours));
    System.out.println(": לאנג'לה" + (Hours*Answer));
    System.out.println("טיפ לשעה: " + ((((Alltip-Hafrasha)/Hours))-Answer));
    }
    }

    Ignore the hebrew...
    Anyway, I click "create jar", specify the class, it creates one on the desktop.
    Then, when I double click it, nothing happens. I need this to work as a standalone...
    It has the main method and I've went through a bunch of tutorials, and have no idea what's wrong.
    Any thoughts?
    Thanks a lot.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,193
    Rep Power
    19

    Default Re: Unable to create working JAR

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,193
    Rep Power
    19

    Default Re: Unable to create working JAR

    Console programs need to be run from a command prompt. If you need a standalone, learn to create a GUI.
    Trail: Creating a GUI With JFC/Swing (The Java™ Tutorials)
    or
    JavaFX Documentation Home | JavaFX 2 Tutorials and Documentation

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    orbutbul is offline Member
    Join Date
    Feb 2013
    Posts
    2
    Rep Power
    0

    Default Re: Unable to create working JAR

    Quote Originally Posted by DarrylBurke View Post
    Console programs need to be run from a command prompt. If you need a standalone, learn to create a GUI.
    Trail: Creating a GUI With JFC/Swing (The Java™ Tutorials)
    or
    JavaFX Documentation Home | JavaFX 2 Tutorials and Documentation

    db
    Thanks a-lot.
    I'll look more carefully next time.

Similar Threads

  1. Replies: 0
    Last Post: 01-11-2013, 10:02 PM
  2. Unable To Create Folders
    By PhQ in forum New To Java
    Replies: 5
    Last Post: 09-05-2012, 12:13 AM
  3. Unable to create a JLabel object
    By Morning-owl in forum New To Java
    Replies: 3
    Last Post: 03-06-2011, 06:41 PM
  4. Unable to create and write files
    By DrKilljoy in forum New To Java
    Replies: 4
    Last Post: 09-05-2010, 12:55 AM
  5. Replies: 0
    Last Post: 04-11-2010, 11:14 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
  •