Results 1 to 9 of 9

Thread: Please Tell me.

  1. #1
    jaminee is offline Member
    Join Date
    Jul 2010
    Posts
    7
    Rep Power
    0

    Default Please Tell me.


    Hy
    I am new in java programing.Please anybody tell me how to create java program in command line and how to run in command line .

    Thanks in Advance.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,340
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by jaminee View Post
    I am new in java programing.Please anybody tell me how to create java program in command line and how to run in command line .

    Thanks in Advance.
    I bet you haven't read the first Sun Tutorials, because if you had you would have known this. And please don't write using those awfully big and fat letters, it feels like shouting and my eyes are good enough to read ordinary text.

    kind regards,

    Jos

  3. #3
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Default

    Wellcome

    Prove us you know Java basic things. Uncode my signature. And tell us what it says...

    Then I think we going to give you some tips ;)
    If my answer helped you. Please click my "REP" button and add a comment
    Have a Good Java Coding :)

  4. #4
    Singing Boyo is offline Senior Member
    Join Date
    Mar 2009
    Posts
    552
    Rep Power
    6

    Default

    Hey Jos, can we have fun bugging Webuser here too? (note to OP - webuser is trying to get you to enhance his reputation, and has not offered any useful tips. Reading the Sun Tutorials is a good idea.)

    Now, about the original post: No bold letters please - rather than helping, it made my eyes hurt :O

    The commands are somewhat similar to this (note that if it says it cannot find javac or java, your environment paths don't have the SDK directory in them)

    For compiling, assuming you want the standard src directory for code and bin directory for class files, and you are in the directory that contains both of those as sub-dirs:
    Java Code:
    javac -d bin -cp src packagename/MyClassName.java
    For running, assuming the same setup:
    Java Code:
    java -cp bin packagename.MyClassName
    The above should work, however, don't quote me on it - the sun tutorials linked by JosAH will be much more helpful.
    If the above doesn't make sense to you, ignore it, but remember it - might be useful!
    And if you just randomly taught yourself to program, well... you're just like me!

  5. #5
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Exclamation

    Quote Originally Posted by Singing Boyo View Post
    Hey Jos, can we have fun bugging Webuser here too? (note to OP - webuser is trying to get you to enhance his reputation, and has not offered any useful tips. Reading the Sun Tutorials is a good idea.)

    Now, about the original post: No bold letters please - rather than helping, it made my eyes hurt :O

    The commands are somewhat similar to this (note that if it says it cannot find javac or java, your environment paths don't have the SDK directory in them)

    For compiling, assuming you want the standard src directory for code and bin directory for class files, and you are in the directory that contains both of those as sub-dirs:
    Java Code:
    javac -d bin -cp src packagename/MyClassName.java
    For running, assuming the same setup:
    Java Code:
    java -cp bin packagename.MyClassName
    The above should work, however, don't quote me on it - the sun tutorials linked by JosAH will be much more helpful.
    Forum is not a place for code giving... It is a place for help sharing.
    Sending people to Sun tutorials is not good because it contains too much info and most of members don't know what to look for especially beginners.

    Not to keep people unthinking we must be sure they put some efford into the threads they create here... that's why it is important to know that a member is at least trying to learn Java but something is not easy and then forum helps.
    If my answer helped you. Please click my "REP" button and add a comment
    Have a Good Java Coding :)

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,340
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Webuser View Post
    Sending people to Sun tutorials is not good because it contains too much info and most of members don't know what to look for especially beginners.
    We have to nail that remark on the door to the "Stupidest Remarks In The Forums" hall. Those tutorials are the best we have; they explain everything from the simplest beginning; that was what the OP's question was about. Instead of regurgitating the tutorials a simple link is more adequate.

    kind regards,

    Jos

  7. #7
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Default

    Quote Originally Posted by JosAH View Post
    We have to nail that remark on the door to the "Stupidest Remarks In The Forums" hall. Those tutorials are the best we have; they explain everything from the simplest beginning; that was what the OP's question was about. Instead of regurgitating the tutorials a simple link is more adequate.

    kind regards,

    Jos
    If you want to send members to sun tutorials only it is your choice... But I think we should send them not to the whole tutorials but to specify the sun tutorial link the thread is about. That's what I mean :)

    So... For this thread I recommend reading this
    Essentials, Part 1, Lesson 1: Compiling & Running a Simple Program
    If my answer helped you. Please click my "REP" button and add a comment
    Have a Good Java Coding :)

  8. #8
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,340
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Webuser View Post
    If you want to send members to sun tutorials only it is your choice... But I think we should send them not to the whole tutorials but to specify the sun tutorial link the thread is about. That's what I mean :)

    So... For this thread I recommend reading this
    Essentials, Part 1, Lesson 1: Compiling & Running a Simple Program
    Ah, but now you have changed your story; you didn't say that in your original reply. Strange ...

    Jos

  9. #9
    Singing Boyo is offline Senior Member
    Join Date
    Mar 2009
    Posts
    552
    Rep Power
    6

    Default

    Quote Originally Posted by Webuser View Post
    If you want to send members to sun tutorials only it is your choice... But I think we should send them not to the whole tutorials but to specify the sun tutorial link the thread is about. That's what I mean :)
    As the OP does not know how to compile via command line, one might safely assume that he will need help with quite a few other things as well. I'd say sending him to the general Sun Tutorials is a good idea. There are times where specific links are needed... not so much in this case.
    If the above doesn't make sense to you, ignore it, but remember it - might be useful!
    And if you just randomly taught yourself to program, well... you're just like me!

Posting Permissions

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