Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

debug in QSH

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • debug in QSH

    Let me start by saying that you should not develop Java applications on the AS/400. The iSeries is great for deploying Java but terrible for development. You'd be far better off testing and debugging from a Java IDE like Visual Age for Java or, better yet, the latest WDSc from IBM. That said, the way to debug Java on the iSeries (or anywhere for that matter) is with the jdb utility. From Qshell key jdb and you'll get a list of options. For instance, to breakpoint at a specific line use: stop at com.yourlib.YourClass:197 Then to start the app use: run com.yourlib.YourClass or whatever the entry point Java class is that has a main method. you can use stop in com.yourlib.YourClass.someMethod() to stop at the beginning of a method. Once a breakpoint is hit, the debugger will show you the line to be execute (and just that one line so you ought to have the source listed in another window). You can use the print command to list just about anything: print localVariable.toString and you can use the dump command to list object info: dump customerObject the next command goes to the next line in that source whereas step steps into the next statement (which may be in anther source). the cont command continues to next breakpoint. Oh, and don't forget, the Java class has to be compiled with the hyphen 'g' option to add debugging info: javac -g com.yourlib.YourClass.java For more sophisticated debugging, you can create a file called .jdbrc (that's right dot jdbrc with no prefix) in your home directory and the jdb qshell command will execute any jdb commands in the .jdbrc file. Don Denoncourt (also a cyclist)

  • #2
    debug in QSH

    Well I guess I have to take the long road and learn VAJ; I can't find jdb on our system. And we're still at V4R5, so the "free" version of Websphere development tools is still on the horizon... Is that what you mean by WDSc? Trevor

    Comment


    • #3
      debug in QSH

      Do not learn VAJ. Absolutely do not do anything with VAJ. It is dead. Long live WDSc (WebSphere Develoment Studio Client). I mentioned VAJ in my last email in case you already were using it. VAJ has been supplanted by IBM with, for iSeries customers, WDSc. WDSc replaces the free VAJ bundled with the iSeries development tools. You can download WDSc from IBM as a PTF. You can also download trials of WSSD and WSAD which are basically the same Java IDE product but without the iSeries-specific wizards. VAJ is Dead -- Long live WDSc/WSSD/WSAD.

      Comment


      • #4
        debug in QSH

        your are right. The jdb Java command is not on the iSeries. All the other ones are like javap, javadoc, javah, etc. but not jdb. At any rate, you can debug java on the iSeries using exactly what you started out with: RUNJVA OPTION(*DEBUG) the problems is that OS/400 optimizes your Java past the point of being able to debug it so you need to use the following options in RUNJVA: RUNJVA CLASS('YourClassName') OPTIMIZE(*INTERPRET) INTERPRET(*YES) OPTION(*DEBUG) with those options set [but don't forget your classpath] you'll see your Java source pop up in the standard iSeries debugger. You can add break points and run the other debug command just like you do in RPG debugging. The only difference about Java debugging is that the eval debug command supports full indirection: eval this.that.theother.thing And as to WDSc not being available for OS/400 V4R5. If you are going to move to V5 within a couple of months, download the WSSD (WebSphere Studio Site Developer) 60 trial. WSSD's Java interface is EXACTLY like WDSc. You could also download the base WDSc/WSSD/WSAD product from www.eclipse.org -- it's entirely free. But eclipse lacks some of the wizards the WDSc/WSSD/WSAD has. Otherwise WSSD is about $1200. The thing is, learning VAJ is a bigger waste of your company's money (via your time) than paying $1200 or so.

        Comment


        • #5
          debug in QSH

          We're not moving to V5 until we migrate our OfficeVision application to something else. And that looks like early next year. "WebSphere Studio Site Developer" is that the trial version at this site? http://www14.software.ibm.com/webapp...S_TACT=&S_CMP=

          Comment


          • #6
            debug in QSH

            how do you debug a java class? I've compiled my class with javac but don't see any way to debug in this mode. So I tried RUNJVAPGM from the command line with OPTION(*DEBUG) but it can't find the class. I tried all combinations of where my class is: Echo03c and Echo03c.class and /home/Trevs/Echo03c but it still can't find it. Trevor

            Comment


            • #7
              debug in QSH

              WDSc V4R5 and higher: www.ibm.com/software/ad/wds400 for existing license program 5722-WDS customers refresh feature code of 2655 you can buy WDSc independant of WDS using Passport Advantage order code D5165LL Eclipse home page: http://www.eclipse.org WebSphere Studio Application Developer and Site Developer Download page: http://www7b.software.ibm.com/wsdd/downloads/

              Comment

              Working...
              X