Results 1 to 4 of 4
  1. #1
    wavydavy is offline Member
    Join Date
    Jan 2012
    Posts
    2
    Rep Power
    0

    Default jdb and System.in.read() problem

    Hi,
    Firstly I have read the following:
    how to use jdb.exe

    This is the problem I have but I find it difficult to believe there is no other help with this issue.

    There appears to be very little help/documentation on jdb. There are no books on amazon dedicated to it.
    I expected jdb to be the java equivalent to gdb (which is a complete debugging tool and has loads of books dedicated to it), but I'm beginning to think that it's not.

    Searching for "jdb" in google brings as the top result the jdk 1.3 documentation. But when I navigate manually to:
    jdb - The Java Debugger
    which is the latest release it reads the same thing:
    "The Java Debugger, jdb, is a simple command-line debugger for Java classes. It is a demonstration of the Java Platform Debugger Architecture that provides..." (my emphasis)

    From the above should I infer that jdb is an example of a debugger for java, but not a production strength one?

    If this is the case, is my only option to use an IDE for my debugging (eclipse, NetBeans etc)?

    Sorry if this sounds like a rant.

    If there is a way to set up my environment to overcome this, then I'd be much appreciative. (oh, I'm using linux)

    Thanks

  2. #2
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default Re: jdb and System.in.read() problem

    If you look at the reply in the post you referred to, there was an answer given there.

    Use a FileReader and FileWriter.

    FileWriter (Java 2 Platform SE v1.4.2)
    FileReader (Java 2 Platform SE v1.4.2)

    InputStream (Java 2 Platform SE v1.4.2)
    OutputStream (Java 2 Platform SE v1.4.2)

    You can write Strings to text files (log files).

    Also, why do you need JDB to debug your program? When you run a java program from command-line, the errors are printed there anyway. Or is it different on linux?

  3. #3
    wavydavy is offline Member
    Join Date
    Jan 2012
    Posts
    2
    Rep Power
    0

    Default Re: jdb and System.in.read() problem

    Cheers for the reply.
    I don't think the answer given in the previous post answers the issue. It just gives a workaround for a flaw.
    Other debuggers can debug that code, ok, they're GUI debuggers, but that's beside the point.
    Surely a debugger should be able to debug any java code.

    > Also, why do you need JDB to debug your program?
    I suppose strictly speaking I don't need JDB. But I do require (self imposed requirement) a command line debugger, and I don't think that's too much to ask. But I can't find any java console debugger other than JDB.
    >When you run a java program from command-line, the errors are printed there anyway.
    That method is not debugging.

    I suppose Sun (or Oracle now) need to answer this question, since they develop the thing.

  4. #4
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default Re: jdb and System.in.read() problem

    So I don't know anything about JDB so i'm not much use for you there...

    I did however google "jdb debugger" and the 2nd result was a tutorial on using it:
    Debug with jdb - JavaWorld

    Which may be of more use to you.

Similar Threads

  1. System.in.read(); to a char array
    By larsjuh in forum New To Java
    Replies: 5
    Last Post: 10-22-2011, 02:26 PM
  2. System.in.read()
    By bhauteshved in forum New To Java
    Replies: 1
    Last Post: 09-08-2011, 03:53 AM
  3. System.in.read()
    By Adithi in forum New To Java
    Replies: 3
    Last Post: 08-07-2011, 05:19 PM
  4. System.in.read() confusion
    By ankurdh in forum New To Java
    Replies: 5
    Last Post: 01-08-2009, 08:28 AM
  5. System.in.read(); strange error!
    By kantze in forum New To Java
    Replies: 2
    Last Post: 03-19-2008, 01:44 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
  •