Loading ...
Sorry, an error occurred while loading the content.

Re: [Clip] java compiling and execution

Expand Messages
  • Wayne VanWeerthuizen
    ... What follows is taken from some old posts of mine, and a post from Larry Hamilton. The clips do assume the use has some experience with NoteTab, but we
    Message 1 of 2 , Aug 25, 2000
    • 0 Attachment
      Dick Meehan wrote:

      >Can anyone tell me (inexperienced notetab user) where to look to find
      >a clip that will allow me to get up to speed using notetab to edit,
      >compile, and run java files? There is a clip library called javacide
      >posted at Fookes site on aug 11 but I'm afraid to open it -- the name
      >is a little creepy.

      What follows is taken from some old posts of mine, and a post
      from Larry Hamilton. The clips do assume the use has some
      experience with NoteTab, but we can offer further help if you
      need it.


      :::

      Subject: [Clip] Clips for Java
      From: Wayne VanWeerthuizen <wayne@...>
      Date: Tue, 28 Dec 1999 23:13:55 -0800

      :::

      Below are two clips for compiling java applets or applications
      from within NoteTab.

      The first clip requires sun's compiler, called 'javac', to be
      located at "C:\jdk\bin\javac.exe" If your copy of javac is stored
      elsewhere, you'll need to modify the path in the clip. The second
      clip checks where the cursor is at in javac's error output, and
      opens the source code file to the appropriate place. This is a
      very nice time saver.

      I hope this makes sense to the java programmers who read this list.
      If you program in java and use NoteTab, and do not understand how
      to use these clips, send me a email. Also send me an email if you
      find ways these clips could be improved.


      H="Compile Java"
      ;// Get rid of old error file, so we don't get misled by seeing it around
      ^!SET %ErrorFile%=^$GetStdErrorName$
      ^!DestroyDoc ^%ErrorFile%
      ;// Make sure source code is saved
      ^!Save
      ^!Set %File%=^**
      ;// Prepare a place to put the command's output
      ^!Set %DocIndex%=^$GetDocIndex$
      ^!Toolbar "New Document"
      ;// Compile the java applet
      ^!InsertText ^$GetOutput("C:\JDK\BIN\JAVAC -deprecation" "^%File%")$
      ;// Close the file if command produced no output.
      ^!If ^$GetTextSize$ > 1 SKIP
      ^!Close DISCARD
      ;// Check for an error file
      ^!IFFILEEXIST "^%ErrorFile%" DISPLAYERROR
      ;// No errors to refocus on source code document
      ^!SetDocIndex ^%DocIndex%
      ^!GOTO END
      ;// Load and display errors
      :DISPLAYERROR
      ^!OPEN ^%ErrorFile%
      ^!SetWordWrap ON
      ^!SOUND SystemExclamation



      H="Jump to Line from Error Output"
      :Redo
      ^!FocusDoc
      ; Look from current cursor position for something resembling:
      ; <Path and Filename><colon><number><colon><space>
      ^!Select LINE
      ^!Find ": " SH
      ^!IfError Error
      ^!Jump Select_Start
      ^!Set %Position%="^$GetRow$:^$GetCol$"
      ^!Find ":" BS
      ^!IfError Error
      ^!Jump Select_End
      ^!SelectTo ^%Position%
      ^!Set %Line%="^$GetSelection$"
      ; Line Number has been found.
      ^!Jump Select_Start
      ^!MoveCursor -1
      ^!Select BOL
      ^!Set %File%="^$GetSelection$"
      ; Filename has been found.
      ^!Open ^%File%
      ^!Jump ^%Line%
      ^!Goto Exit
      ; If we had an error, it means a find failed, which means the
      ; cursor was not on the first line of an error message. We back
      ; up a line and try again. (The -2 is because the above code
      ; moves the cursor down a during the search line.)
      :Error
      ^!If ^$GetRow$ < 2 Exit
      ^!Jump -2
      ^!Goto Redo






      :::

      Subject: [Clip] Re: Java Clips
      From: "Lawrence M Hamilton, Jr." <lmhamilton@...>
      Date: Wed, 22 Mar 2000 09:20:02 -0600

      :::

      Hey Clippers!

      In December and January, Wayne shared some clips for helping with
      development of Java applets.

      I have been playing some with Java, and came up with these for use with
      the Applet Viewer. I am using Java 1.0.2, so I do not know about newer
      versions of the JDK. The second clip is for use with the -debug option of
      the Applet Viewer. I do not know about using the debugger yet, I just
      wanted to get these two features working from NoteTab to save on typing
      at a command line. They could easily be made into one clip with a listbox
      or combobox.

      I have also included Wayne's Compile Java Clip to show a modification I
      had to make to get it to work with JDK 1.0.2. I have not yet gotten real
      serious with it, so I am not in a hurry to get another download, unless
      there are some major improvements for the beginner.

      Wayne also had a clip for reading the error log (search on Clips List,
      January 11) and opening the Source Code at the offending line number.
      With the combination of these clips, I was able to type in an applet from
      a computer magazine, and find all my typos, and even problems in the
      printed text, and get the applet to compile and run in the viewer. Very
      cool!

      I have even figured out how to tweak some Java applets I found on the
      web. Now all I have to do is learn it well enough to write some of my
      own. NoteTab and these clips make it VERY easy!

      THANKS WAYNE!

      ---------< start clip >-----------
      H="Applet Viewer 2"
      ;Larry Hamilton, Jr. <lmhamilton@...>
      ;03/22/2000, 08:53:05 AM
      ;The Applet Viewer allows you to run a Java Applet without using your web
      browser.
      ;Set path to your Java\bin directory.
      ^!Set %file%=^$GetFileName(^**)$
      ^!D:\java\bin\appletviewer ^%file%
      ---------< end clip >-----------

      ---------< start clip >---------
      H="Debugger"
      ;Larry Hamilton, Jr. <lmhamilton@...>
      ;03/22/2000, 09:00:15 AM
      ;Invoke -debug option of appletviewer. (only option)
      ;You can find documentation on the debugger and its API at:
      ; http://java.sun.com/products/JDK/debugging/

      ^!Set %file%=^$GetFileName(^**)$
      ^!D:\java\bin\appletviewer -debug ^%file%
      ---------< end clip >-----------

      ---------< start clip >-----------
      ;Wayne VanWeerthuizen <wayne@...>
      ;Tue, 28 Dec 1999 23:13:55 -0800
      ;This clip requires sun's compiler, called 'javac', to be
      ;located at "C:\jdk\bin\javac.exe" If your copy of javac is stored
      ;elsewhere, you'll need to modify the path in the clip.
      ;// Get rid of old error file, so we don't get misled by seeing it around
      ^!SET %ErrorFile%=^$GetStdErrorName$
      ^!DestroyDoc ^%ErrorFile%
      ;// Make sure source code is saved
      ^!Save
      ^!Set %File%=^**
      ;// Prepare a place to put the command's output
      ^!Set %DocIndex%=^$GetDocIndex$
      ^!Toolbar "New Document"
      ;// Compile the java applet

      ;NOTE: The following command line was in Wayne's original clip, but it
      produced an error in JDK 1.0.2.
      ;The second line following is the compile command that works in JDK
      1.0.2.

      ;^!InsertText ^$GetOutput("C:\JDK\BIN\JAVAC -deprecation" "^%File%")$
      ^!InsertText ^$GetOutput("D:\java\bin\JAVAC" "^%File%")$
      ;// Close the file if command produced no output.
      ^!If ^$GetTextSize$ > 1 SKIP
      ^!Close DISCARD
      ;// Check for an error file
      ^!IFFILEEXIST "^%ErrorFile%" DISPLAYERROR
      ;// No errors to refocus on source code document
      ^!SetDocIndex ^%DocIndex%
      ^!GOTO END
      ;// Load and display errors
      :DISPLAYERROR
      ^!OPEN ^%ErrorFile%
      ^!SetWordWrap ON
      ^!SOUND SystemExclamation
      ---------< end clip >-----------

      Larry Hamilton, Jr. lmhamilton@...
      Hamilton National Genealogical Society, Inc.
      http://www.HamiltonGenSociety.org/
      My Web Site: http://notlimaH.tripod.com




      --
      Wayne M. VanWeerthuizen
      Homepage: http://landru.myhome.net/wayne
    Your message has been successfully submitted and would be delivered to recipients shortly.