Results 1 to 7 of 7
  1. #1
    kureikougaiji is offline Member
    Join Date
    Nov 2007
    Posts
    15
    Rep Power
    0

    Default accessing command prompt using java (netbeans)...

    hello.. i'm a 4th year college student here in Philippines, and i am now doing my thesis.. can somebody teach me and give me a source code on how to access command prompt using java specifically netbeans..??.. please.. thanks..

  2. #2
    staykovmarin is offline Senior Member
    Join Date
    Nov 2007
    Location
    Newport, WA
    Posts
    141
    Rep Power
    0

    Default

    How do you mean? you mean to be able to do something like:
    Java Code:
    ping www.google.com
    and print the results?
    Runtime can do that

  3. #3
    kureikougaiji is offline Member
    Join Date
    Nov 2007
    Posts
    15
    Rep Power
    0

    Default

    no.. how can i run the command prompt using java without going to it..??.. i don't know how to put it in words correctly..

  4. #4
    staykovmarin is offline Senior Member
    Join Date
    Nov 2007
    Location
    Newport, WA
    Posts
    141
    Rep Power
    0

    Default

    Thats exactly what the Runtime class does. (with help of the Process class)
    Here is an example: Executing a Command (Java Developers Almanac Example)

    edit:
    Or do you mean to make the command prompt show up? You can use the above example and execute "cmd" which will open a new command prompt.

  5. #5
    kureikougaiji is offline Member
    Join Date
    Nov 2007
    Posts
    15
    Rep Power
    0

    Default

    so i can compile and execute a java source code in a java system using that?... thanks!!!...

  6. #6
    freakysk is offline Member
    Join Date
    Jun 2008
    Posts
    1
    Rep Power
    0

    Question dont want the cmd console

    what if i want to execute a command from java and i dont need the command prompt console pop up? i just need to execute the cmd....

  7. #7
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

Similar Threads

  1. How do I show * in a password prompt?
    By tanalyw in forum New To Java
    Replies: 3
    Last Post: 04-16-2008, 02:09 PM
  2. Java command line
    By agouzoul in forum New To Java
    Replies: 2
    Last Post: 04-02-2008, 12:12 PM
  3. Unable to execute command line command in java
    By LordSM in forum New To Java
    Replies: 1
    Last Post: 08-08-2007, 12:23 AM
  4. Replies: 2
    Last Post: 08-06-2007, 09:16 PM
  5. how to issue the command of Ctrl-C (copy) in Java
    By bilal_ali_java in forum Advanced Java
    Replies: 0
    Last Post: 07-18-2007, 03: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
  •