Results 1 to 2 of 2

Thread: .jar wont run?

  1. #1
    Join Date
    Jun 2011
    Posts
    21
    Rep Power
    0

    Default .jar wont run?

    Hey all,

    I'm having a problem running a .jar under Mac that I wrote. There's a dialog that pops up and the dialog says to check the console. The console says I don't have permission to open that file. Do I need to include something else in the code? Here it is:

    Java Code:
    import java.util.Scanner;
    
    
    public class apples {
        
    public static void main(String[] args) {
    
           Scanner myScanner = new Scanner(System.in);
    	
           String first,last,yorn;
            
           System.out.println("What's your first name?");
    
           first = myScanner.nextLine();
           
           System.out.println("What's your last name?");
           
           last = myScanner.nextLine();
           
           System.out.println("Really? Your name is " + first + " " + last + "?");
           System.out.println("Do you like your name? PRESS Y/N");
    
           yorn = myScanner.nextLine();
           if (yorn.equals("y"))
               System.out.println("Really? Dang. I wouldn't.");
           else{
               System.out.println("Tough luck!");
           }
    	}
    
    }

  2. #2
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    618
    Rep Power
    4

    Default

    First can you explain how you make this jar? I think you know that you need make special run JAR, There you can read about it. Running JAR-Packaged Software (The Java™ Tutorials > Deployment > Packaging Programs in JAR Files)
    Skype: petrarsentev
    http://TrackStudio.com

Similar Threads

  1. wont print zero
    By jjth39347 in forum New To Java
    Replies: 16
    Last Post: 03-27-2011, 01:35 AM
  2. Able to compile OK, But wont run..Help
    By subiedude101 in forum New To Java
    Replies: 2
    Last Post: 02-20-2011, 08:37 PM
  3. Why wont this compile?
    By Student101 in forum New To Java
    Replies: 8
    Last Post: 11-18-2010, 05:33 AM
  4. wont validate
    By karq in forum XML
    Replies: 1
    Last Post: 10-07-2010, 05:33 PM
  5. why wont it compile
    By bje98f in forum Advanced Java
    Replies: 1
    Last Post: 04-23-2009, 10:55 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
  •