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 3 of 3
  1. #1
    Registered User
    Join Date
    Oct 2004
    Posts
    592
    Thanks
    0
    Thanked 1 Time in 1 Post

    Question Help me!! I am fresher newbie. Java help? info?

    Hi masters,

    I can run javac only at j2sdk1.4.1_02\bin folder. I can't run it outside.
    I tried to fill the variables path like d:\j2sdk1.4.1_02\bin in system > Advance > Environments variables. But it was in vain.
    Next, however I type the java codes exactly and correctly as the same as in the textbook, some can't be run and errors poped out like "NoSuchMethodError :main"
    Help me, please.

    iota

  • #2
    Regular Coder
    Join Date
    Feb 2003
    Location
    California
    Posts
    925
    Thanks
    0
    Thanked 0 Times in 0 Posts
    post the code here, some books use different headers, and they need minor changes to work in different environments. As far as not being able to run the javac prog, don't know, thats out of my reach...


    Jason

  • #3
    New Coder
    Join Date
    Nov 2004
    Posts
    54
    Thanks
    0
    Thanked 0 Times in 0 Posts
    First, go back to the environment variable tab. Look at the system variables table and find Path, click it and then click edit. Add a semi-colon to the end of the list and then the path to your bin directory for java. c:\java\bin, something like that. Then open up a command prompt and type javac. As long as it recognizes the command, you'll be able to run from anywhere.

    run javac against a .java file and java against a .class file.

    The error you are seeing suggests to me that you are trying to compile a class that doesn't have a main method in it. ie, public static void main(String[] args){....}

    You also have to run a main class. You cannot run a java helloworld if the class has no main. Check these points out. I hope I made sense. Good luck.


  •  

    Posting Permissions

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