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

[NTB] Using clips to launch javac.exe to compile .java files

Expand Messages
  • Terence Song
    I started using notetab when it was in version 4.xx. I am currently using it as an editor for editing .java files. Does anyone out there know how I can use
    Message 1 of 10 , Nov 27, 1998
      I started using notetab when it was in version 4.xx. I am currently using it as an editor for editing .java files. Does anyone out there know how I can use clips to launch javac.exe to compile .java files and leaving the command prompt window open after the compiler finishes? Here is the script for the above...

      ^!javac "^**" //runs compiler on current file

      The thing is, after compiling, if there is an error message from the compiler, I am unable to see, thus don't know whether the compile was successful or not because the command promp window for the compiler closes as soon as the compilation is done. Is there anyway to do it in a way that closing the window would have to be done manually??
      ------------------------------------------------------------------------
      Free Web-based e-mail groups -- http://www.eGroups.com
    • R.S.
      Hi Terence, ... ^$GetOutput( Param )$ Returns Console output. Param represents command to execute. The stderr stream is saved in file called StdError.err in
      Message 2 of 10 , Nov 27, 1998
        Hi Terence,


        >^!javac "^**" //runs compiler on current file
        >
        >The thing is, after compiling, if there is an error message from the compiler, I am unable to see,


        ^$GetOutput("Param")$
        Returns Console output. Param represents command to execute. The stderr stream is saved in file called "StdError.err" in NoteTab's application directory.
        Example: ^$GetOutput(command.com /c dir c:\*.*)




        For example, to see the results of a DOS window): ^!Info:^$GetOutput("c:\pp\demo\MAGIC.exe")$
        or
        To get the Console Output pasted into the document:
        ^$GetOutput(C:\PP\DEMO\MAGIC.EXE)$

        I'd try:

        ^$GetOutput(^!javac "^**")$

        You might need to insert the full Path to the Compiler if it is not in your Path.

        For a working example, take a look at the clips I used to launch the Pascal Compiler:

        http://pages.prodigy.net/rcsilv/main/index.htm


        Regards,


        RS
        ------------------------------------------------------------------------
        Free Web-based e-mail groups -- http://www.eGroups.com
      • MKT Song
        Hi RS, Thanks for your suggestion. Unfortunately, I am using NT Light. Since this command is only available in the commercial and trial versions of NoteTab, I
        Message 3 of 10 , Nov 30, 1998
          Hi RS,

          Thanks for your suggestion. Unfortunately, I am using NT Light. Since this
          command is only available in the commercial and trial versions of
          NoteTab, I am unable to use it. Is there an alternative? Many thanks.

          Regards,
          Terence
          ----------------------
          MKT Song
          Centre for Communications Research
          University of Bristol
          Terence.Song@...

          On Fri, 27 Nov 1998, R.S. wrote:

          > Hi Terence,
          >
          >
          > >^!javac "^**" //runs compiler on current file
          > >
          > >The thing is, after compiling, if there is an error message from the compiler, I am unable to see,
          >
          >
          > ^$GetOutput("Param")$
          > Returns Console output. Param represents command to execute. The stderr stream is saved in file called "StdError.err" in NoteTab's application directory.
          > Example: ^$GetOutput(command.com /c dir c:\*.*)
          >
          >
          >
          >
          > For example, to see the results of a DOS window): ^!Info:^$GetOutput("c:\pp\demo\MAGIC.exe")$
          > or
          > To get the Console Output pasted into the document:
          > ^$GetOutput(C:\PP\DEMO\MAGIC.EXE)$
          >
          > I'd try:
          >
          > ^$GetOutput(^!javac "^**")$
          >
          > You might need to insert the full Path to the Compiler if it is not in your Path.
          >
          > For a working example, take a look at the clips I used to launch the Pascal Compiler:
          >
          > http://pages.prodigy.net/rcsilv/main/index.htm
          >
          >
          > Regards,
          >
          >
          > RS
          > ------------------------------------------------------------------------
          > Free Web-based e-mail groups -- http://www.eGroups.com
          >
          >

          ------------------------------------------------------------------------
          Free Web-based e-mail groups -- http://www.eGroups.com
        • Sami Jarvinen
          ... this ... You could make a batch file which executes javac.exe and redirects output to a file, then you could read that file in NoteTab. This is what I do
          Message 4 of 10 , Nov 30, 1998
            >> ^$GetOutput("Param")$
            > Thanks for your suggestion. Unfortunately, I am using NT Light. Since
            this
            > command is only available in the commercial and trial versions of
            > NoteTab, I am unable to use it. Is there an alternative? Many thanks.

            You could make a batch file which executes javac.exe and redirects output
            to a file, then you could read that file in NoteTab. This is what I do in
            my JavaClips, a perhaps-soon-to-be-released clip library for Java
            programmers.
            ------------------------------------------------------------------------
            Free Web-based e-mail groups -- http://www.eGroups.com
          • Jody
            Hi Terrence and Sami, ... There is an option in some Dos windows to Close on Exit. I have no clue how to get to the window that comes up, but possibly that
            Message 5 of 10 , Dec 1, 1998
              Hi Terrence and Sami,

              >>> ^$GetOutput("Param")$

              >You could make a batch file which executes javac.exe and
              >redirects output to a file, then you could read that file
              >in NoteTab. This is what I do in my JavaClips, a perhaps-
              >soon-to-be-released clip library for Java programmers.

              There is an option in some Dos windows to "Close on Exit."
              I have no clue how to get to the window that comes up, but
              possibly that could be unchecked if checked??? I tried to
              find the one that FTP.exe uses at one time to run in
              minimized, but had no luck.

              Happy NoteTabbin',
              Jody Adair
              http://www.mindspring.com/~kjb1611/notetab/notetab.htm
              ------------------------------------------------------------------------
              Free Web-based e-mail groups -- http://www.eGroups.com
            • Sami Jarvinen
              ... Can you expand on that? I m sorry but I have no idea what you re talking about =) ... Free Web-based e-mail groups -- http://www.eGroups.com
              Message 6 of 10 , Dec 1, 1998
                >>>> ^$GetOutput("Param")$
                >> You could make a batch file which executes javac.exe and
                >> redirects output to a file, then you could read that file
                >> in NoteTab. This is what I do in my JavaClips, a perhaps-
                >> soon-to-be-released clip library for Java programmers.
                > There is an option in some Dos windows to "Close on Exit."
                > I have no clue how to get to the window that comes up, but
                > possibly that could be unchecked if checked??? I tried to
                > find the one that FTP.exe uses at one time to run in
                > minimized, but had no luck.

                Can you expand on that? I'm sorry but I have no idea what you're talking
                about =)
                ------------------------------------------------------------------------
                Free Web-based e-mail groups -- http://www.eGroups.com
              • Jody
                Hi Larry, Sami, and Terrence, ... Terrence originally asked the question of how to keep the Dos window open after doing his JAVA thing at which time you
                Message 7 of 10 , Dec 1, 1998
                  Hi Larry, Sami, and Terrence,

                  >>There is an option in some Dos windows to "Close on Exit."

                  >Can you expand on that? I'm sorry but I have no idea what you're
                  >talking about =)

                  Terrence originally asked the question of how to keep the Dos window
                  open after doing his JAVA thing at which time you suggested a .bat
                  file. I was mentioning the "Close on Exit" along with some other
                  stuff. Terrence says he doesn't see it on Win98, but did on 95.

                  Anyhow, thatnks Larry - you answer helped me out and looks like it
                  should for Terrence as well. :)

                  >^!CmdShow Minimize
                  >^!Command.com /c Mybatch.bat

                  >Will run the named batch file minimized on the task bar and quit
                  >DOS when finished.

                  >^!CmdShow Minimize
                  >^!command.com /k Mybatch.bat

                  >Will run the named batch file minimized on the task bar but will
                  >leave DOS active when finished. You can get to the DOS window by
                  >clicking on the task bar button. If you do not use the CmdShow
                  >command, the DOS box will appear or a full-screen DOS window if
                  >that is how you quit it the last time you used DOS.


                  c ya,
                  Jody Adair
                  Prov. 3:5-7; 4:23

                  http://www.mindspring.com/~kjb1611
                  ------------------------------------------------------------------------
                  Free Web-based e-mail groups -- http://www.eGroups.com
                • Lawrence R. Thomas
                  Hi Jody, ... You can use the /c and /k switched with command.com as follows: ^!CmdShow Minimize ^!Command.com /c Mybatch.bat Will run the named batch file
                  Message 8 of 10 , Dec 1, 1998
                    Hi Jody,

                    At 10:27 AM 12/1/98 -0600, you wrote:
                    >Hi Terrence and Sami,
                    >
                    >>>> ^$GetOutput("Param")$
                    >
                    >>You could make a batch file which executes javac.exe and
                    >>redirects output to a file, then you could read that file
                    >>in NoteTab. This is what I do in my JavaClips, a perhaps-
                    >>soon-to-be-released clip library for Java programmers.
                    >
                    >There is an option in some Dos windows to "Close on Exit."
                    >I have no clue how to get to the window that comes up, but
                    >possibly that could be unchecked if checked??? I tried to
                    >find the one that FTP.exe uses at one time to run in
                    >minimized, but had no luck.
                    >
                    >Happy NoteTabbin',
                    >Jody Adair

                    You can use the /c and /k switched with command.com as follows:

                    ^!CmdShow Minimize
                    ^!Command.com /c Mybatch.bat

                    Will run the named batch file minimized on the task bar and quit DOS when
                    finished.

                    ^!CmdShow Minimize
                    ^!command.com /k Mybatch.bat

                    Will run the named batch file minimized on the task bar but will leave DOS
                    active when finished. You can get to the DOS window by clicking on the
                    task bar button. If you do not use the CmdShow command, the DOS box will
                    appear or a full-screen DOS window if that is how you quit it the last time
                    you used DOS.

                    Regards,

                    Larry Thomas
                    larryt@...
                    ------------------------------------------------------------------------
                    Free Web-based e-mail groups -- http://www.eGroups.com
                  • MKT Song
                    Hello Jody, Sami and Larry, Thanks for the suggestions and pointers. The batch file thingi should work just fine for what I am doing. Regards, Terence ... MKT
                    Message 9 of 10 , Dec 2, 1998
                      Hello Jody, Sami and Larry,

                      Thanks for the suggestions and pointers. The batch file thingi should work
                      just fine for what I am doing.

                      Regards,
                      Terence
                      ----------------------
                      MKT Song
                      Centre for Communications Research
                      University of Bristol
                      Terence.Song@...

                      On Tue, 1 Dec 1998, Jody wrote:

                      > Hi Larry, Sami, and Terrence,
                      >
                      > >>There is an option in some Dos windows to "Close on Exit."
                      >
                      > >Can you expand on that? I'm sorry but I have no idea what you're
                      > >talking about =)
                      >
                      > Terrence originally asked the question of how to keep the Dos window
                      > open after doing his JAVA thing at which time you suggested a .bat
                      > file. I was mentioning the "Close on Exit" along with some other
                      > stuff. Terrence says he doesn't see it on Win98, but did on 95.
                      >
                      > Anyhow, thatnks Larry - you answer helped me out and looks like it
                      > should for Terrence as well. :)
                      >
                      > >^!CmdShow Minimize
                      > >^!Command.com /c Mybatch.bat
                      >
                      > >Will run the named batch file minimized on the task bar and quit
                      > >DOS when finished.
                      >
                      > >^!CmdShow Minimize
                      > >^!command.com /k Mybatch.bat
                      >
                      > >Will run the named batch file minimized on the task bar but will
                      > >leave DOS active when finished. You can get to the DOS window by
                      > >clicking on the task bar button. If you do not use the CmdShow
                      > >command, the DOS box will appear or a full-screen DOS window if
                      > >that is how you quit it the last time you used DOS.
                      >
                      >
                      > c ya,
                      > Jody Adair
                      > Prov. 3:5-7; 4:23
                      >
                      > http://www.mindspring.com/~kjb1611
                      > ------------------------------------------------------------------------
                      > Free Web-based e-mail groups -- http://www.eGroups.com
                      >
                      >

                      ------------------------------------------------------------------------
                      Free Web-based e-mail groups -- http://www.eGroups.com
                    • MKT Song
                      Hi Larry and Sami, I have written the batch file and clip as you suggested. Here they are. The batch file: @echo off if exist %1.class del %1.class javac
                      Message 10 of 10 , Dec 2, 1998
                        Hi Larry and Sami,

                        I have written the batch file and clip as you suggested. Here they are.

                        The batch file:

                        @echo off
                        if exist %1.class del %1.class
                        javac %1.java
                        pause

                        if exist %1.class goto run
                        it not exist %1.class goto stop

                        :run
                        java %1
                        pause

                        :stop

                        And here is the clip:

                        ^!Set %JFullFilePathWithExt%="^**"
                        ^!Set %FileNameWithExt%=^$StrDelete(^%JFullFilePathWithExt%;1;46)$
                        ^!Set %FileNameSize%=^$StrSize(^%FileNameWithExt%)$
                        ^!Set %DotIndex%=^$[^%FileNameSize% - 4;0]
                        ^!Set %FileNameNoExt%=^$StrDelete(^%FileNameWithExt%;^%DotIndex%;5)$

                        ^!CmdShow Normal
                        ^!Prompt ^%FileNameNoExt%

                        ^!Command.com /c jcr.bat ^%FileNameNoExt%

                        I had to do a few things in the clip to get rid of the full path,
                        otherwise, the batch file would only get part of the path (The path in
                        %1 would be delimited by the first space character encountered).

                        Though the clip and batch file works, there is a limitation. Using the
                        current clip, I cannot pass command line arguments to my java program when
                        I run it (through the "java" interpreter). How do I prompt for text fields
                        from the user and then enter the contents of the text fields into
                        variables when I run the clip.

                        Your suggestions are very much welcomed. Many thanks.

                        Regards,
                        Terence
                        ----------------------
                        MKT Song
                        Centre for Communications Research
                        University of Bristol
                        Terence.Song@...

                        On Tue, 1 Dec 1998, Lawrence R. Thomas wrote:

                        > Hi Jody,
                        >
                        > At 10:27 AM 12/1/98 -0600, you wrote:
                        > >Hi Terrence and Sami,
                        > >
                        > >>>> ^$GetOutput("Param")$
                        > >
                        > >>You could make a batch file which executes javac.exe and
                        > >>redirects output to a file, then you could read that file
                        > >>in NoteTab. This is what I do in my JavaClips, a perhaps-
                        > >>soon-to-be-released clip library for Java programmers.
                        > >
                        > >There is an option in some Dos windows to "Close on Exit."
                        > >I have no clue how to get to the window that comes up, but
                        > >possibly that could be unchecked if checked??? I tried to
                        > >find the one that FTP.exe uses at one time to run in
                        > >minimized, but had no luck.
                        > >
                        > >Happy NoteTabbin',
                        > >Jody Adair
                        >
                        > You can use the /c and /k switched with command.com as follows:
                        >
                        > ^!CmdShow Minimize
                        > ^!Command.com /c Mybatch.bat
                        >
                        > Will run the named batch file minimized on the task bar and quit DOS when
                        > finished.
                        >
                        > ^!CmdShow Minimize
                        > ^!command.com /k Mybatch.bat
                        >
                        > Will run the named batch file minimized on the task bar but will leave DOS
                        > active when finished. You can get to the DOS window by clicking on the
                        > task bar button. If you do not use the CmdShow command, the DOS box will
                        > appear or a full-screen DOS window if that is how you quit it the last time
                        > you used DOS.
                        >
                        > Regards,
                        >
                        > Larry Thomas
                        > larryt@...
                        > ------------------------------------------------------------------------
                        > Free Web-based e-mail groups -- http://www.eGroups.com
                        >
                        >

                        ------------------------------------------------------------------------
                        Free Web-based e-mail groups -- http://www.eGroups.com
                      Your message has been successfully submitted and would be delivered to recipients shortly.