Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    May 2004
    Location
    near Detroit
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    java program won't work?

    i download a java editor/compiler called JJ edit. i've looked around for a sample program and i found one which is supposed to print "im a sample program" on the screen. however when i launch the .jar it sais that there is no main class definition, now i would add one myself but im new to java and have no clue what that is or where to add one, could someon help me with this? the code is below

    Code:
     
    //A Very Simple Example
    class ExampleProgram {
    
       public static void main(String[] args){
    
            System.out.println("I'm a Simple Program");
       }
    }
    thanks alot for any help

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've never used (or heard of it until now), but JJ Edit runs on a Mac, right?
    http://homepage.mac.com/jmacmullin/

    So it looks like you input the source code, press compile, and if there are no errors and JAR file is produced? Then you can either press run, or find the JAR file and run it there. Is that right?

    Do you get the error when pressing the run button or when you try to run the JAR file or both?

    Sadiq.

  • #3
    New Coder
    Join Date
    May 2004
    Location
    near Detroit
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i get an error when i press run, it compiles and produces a jar then when i click the jar i get the error

  • #4
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It's probably an error with your Java setup. Unfortunately I know nothing about Macs, so I cannot help you. I wouldn't even know where to begin.

    What version of Java have you installed? You should see if you can figure out if all the classpaths and all that are setup properly (if that even applies to Macs..). It's usually an issue with the classpath in my experience on Windows.

    Good luck,
    Sadiq.

  • #5
    Regular Coder
    Join Date
    Dec 2003
    Posts
    367
    Thanks
    0
    Thanked 0 Times in 0 Posts


  •  

    Posting Permissions

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