aspose file tools*
The moose likes Beginning Java and the fly likes Java Compilation at MSDOS prompt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java Compilation at MSDOS prompt" Watch "Java Compilation at MSDOS prompt" New topic
Author

Java Compilation at MSDOS prompt

Mark Mokris
Ranch Hand

Joined: May 08, 2002
Posts: 61
Many times I work with Java outside of an integrated environment, and I compile my programs at the MSDOS command prompt with javac.
Frequently, when I write a new program, the initial compiles generate so many syntax errors that the errors at the top scroll off the top of the screen, and I lose them. I can set my MSDOS window to 50 lines, but this isn't always sufficient.
Has anybody figured out a solution to this?
Thanks,
Mark
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

You can pipe the output to a file.
e.g. 'javac Test.java > compileResult.log'
If you are using Windows NT/2000/XP then you can specify a very large screen buffer.
/Rene


Regards, Rene Larsen
Dropbox Invite
DanCranmer
Greenhorn

Joined: Jul 03, 2002
Posts: 2
Errors need to be redirected using the following:
javac Test.java 2> compileResult.log
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
Depending on your OS you may also be able to change the buffer size.
Mark Mokris
Ranch Hand

Joined: May 08, 2002
Posts: 61
I coded a Java program which contains syntax errors. At the MSDOS prompt I typed:
javac HelloWorld.java > error.log
It STILL displays my syntax errors on the screen. It creates an error.log file but there is nothing in it. Anybody have any ideas?
Thanks,
Mark Mokris
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

from an earlier post:
Errors need to be redirected using the following:
javac Test.java 2> compileResult.log

/Rene
[ July 16, 2002: Message edited by: Rene Larsen ]
Mark Mokris
Ranch Hand

Joined: May 08, 2002
Posts: 61
Rene and others...
I appreciate what you are saying. Is there something I am not seeing? I type:
javac HelloWorld.java > compileResult.log
The syntax errors still display on my screen. It creates a file called compileResult.log, but there is nothing in it. This is MSDOS. Does the redirect technique only work on UNIX? Does it work for you on MSDOS?
Thanks!
Mark
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

To pipe an error you need to have '2' before the '>'
/Rene
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9047
    
  10
If you are using Win9x, piping errors from javac won't work (unless you are using the jdk 1.1.8 which I doubt). You used to be able to change the setting, but Sun removed that functionality with version 1.3. The only way you'll be able to see all the errors that I know of with Win9x is to use a text editor like TextPad and reroute the output within the text editor.

I suggest clearing the errors you can see and gradually the list will be small enough that you can see all of them.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
You can set your DOS windows to display scroll bars when there are more than 50 lines. Click on properties in your DOS window, under the layout tab, set the height of the screen buffr size to something large like 300.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Mark Mokris
Ranch Hand

Joined: May 08, 2002
Posts: 61
Thanks Rene, Dan, Paul, Marilyn and Bosun!
I appreciate all your advice, but I am running Win/98, and as Marilyn says, I cannot pipe the errors to a file. Nor does it allow me to set the MSDOS screen such that I receive scroll bars. I guess I am just out-of-luck, and will have to clear some of the later errors first.
Thanks!
Mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Compilation at MSDOS prompt