Results 1 to 4 of 4
  1. #1
    jon80's Avatar
    jon80 is offline Senior Member
    Join Date
    Feb 2008
    Location
    Malta (EU)
    Posts
    211
    Rep Power
    7

    Default [SOLVED] [newbie] any DEBUG?

    If I remember well :), in C# it was possible to have portions of code that were used only during debugging such as:


    Java Code:
    IF #DEBUG
    
    assert Expression1 : Expression2;
    
    ENDIF #DEBUG
    Is anything similar possible with Java 1.6? I would be able to switch off/on debug code when deploying the LIVE version to production, without having to comment out a lot of code.

    Environment notes

    Eclipse 3.4.2
    java version "1.6.0_13"
    Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
    Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing)
    Windows box (Windows Server 2008 64 bit)...regrettably :)

  2. #2
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    7

    Default To debug or not to debug....

    Please take a look at the following link:
    Debug challenge: how do you debug a Java program?

    It has plenty of examples of different types of ways to debug, including the one you want to use.

    Luck,
    CJSL
    Chris S.
    Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

  3. #3
    jon80's Avatar
    jon80 is offline Senior Member
    Join Date
    Feb 2008
    Location
    Malta (EU)
    Posts
    211
    Rep Power
    7

    Default

    I figured out that using the "good old" println is pretty much of a popular debugger :)

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

Similar Threads

  1. Debug challenge: how do you debug a Java program?
    By CJSLMAN in forum New To Java
    Replies: 60
    Last Post: 07-04-2009, 10:28 AM
  2. Cannot debug on Eclipse.. and other IDE
    By pexlee in forum Eclipse
    Replies: 0
    Last Post: 09-26-2008, 05:07 PM
  3. Cannot debug in NetBeans as well as other IDE
    By pexlee in forum NetBeans
    Replies: 0
    Last Post: 09-26-2008, 04:45 PM
  4. SciTE-debug 0.9.1
    By Java Tip in forum Java Software
    Replies: 0
    Last Post: 04-10-2008, 04:14 PM
  5. how to debug the servlet
    By tommy in forum Java Servlet
    Replies: 1
    Last Post: 08-06-2007, 08:53 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
  •