Results 1 to 12 of 12
- 04-16-2012, 01:34 AM #1
Member
- Join Date
- Oct 2011
- Location
- New Jersey
- Posts
- 44
- Rep Power
- 0
Too many compile errors in Windows command prompt, Can't see the first one
Hi,
I can't believe I have to post a thread to ask this, but I can't google the answer I need...
My java program gives too many error messages at compilation.
I am pretty sure they are caused by a small syntax error and are all chain-errored, as they are the result of an edit to a working .java file I am developing.. All I need is to see what's error no. 1.
However there are > 100 errors, so windows cmd windows cannot display them. I am not really using a IDE.. (I am installing eclipse right now.. but while I am doing that my curiosity drove me to post here..)
Is there a solution so that I can split the screen so that the screen pauses when the compiling error takes up 1 command window size? or can I output the compile error message the a file?
- 04-16-2012, 01:38 AM #2
Re: Too many compile errors in Windows command prompt, Can't see the first one
Easy enough on Linux. Perhaps the Windows command shell is similar.
You could pipe the output of javac to the 'more' program, which pauses between pages of output: javac YourClass.java | more
(Linux also has an improved version of 'more' called 'less', but I doubt Windows has that.)
Or you could redirect javac's output to a text file: javac YourClass.java > errors.txtGet in the habit of using standard Java naming conventions!
- 04-16-2012, 01:52 AM #3
Member
- Join Date
- Oct 2011
- Location
- New Jersey
- Posts
- 44
- Rep Power
- 0
Re: Too many compile errors in Windows command prompt, Can't see the first one
hi kjkrum!
Thanks for the reply. I've tried those approaches, but they don't work. I came to the conclusion that in windows cmd, the error messages is in a different stream from that in linux?
What I mean is that I can't pipe the compile errors or redirect them to be put in a file.
By the way, windows has more but no less=)
- 04-16-2012, 01:58 AM #4
Re: Too many compile errors in Windows command prompt, Can't see the first one
Hmm. The last Windows I really used was XP, and it had redirection. Microsoft Windows XP - Using command redirection operators What version are you using? Hopefully someone with more up-to-date Windows knowledge can help you.
Edit: maybe you need to specify 2 for the error channel: javac YourClass.java 2> errors.txtLast edited by kjkrum; 04-16-2012 at 02:00 AM.
Get in the habit of using standard Java naming conventions!
- 04-16-2012, 02:36 AM #5
Member
- Join Date
- Oct 2011
- Location
- New Jersey
- Posts
- 44
- Rep Power
- 0
Re: Too many compile errors in Windows command prompt, Can't see the first one
That unfortunately doesn't work either >..<
javac: invalid flag: 2
Usage: javac <options> <source files>
use -help for a list of possible options
- 04-16-2012, 06:09 AM #6
Re: Too many compile errors in Windows command prompt, Can't see the first one
There are two varieties of the Command prompt: command.com and cmd.exe. Have you tried both?
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 04-16-2012, 11:18 AM #7
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: Too many compile errors in Windows command prompt, Can't see the first one
You can increase the screen buffer in the properties menu of the command terminal.
Just give it a 1000 line buffer (or more).Please do not ask for code as refusal often offends.
- 04-16-2012, 02:25 PM #8
Member
- Join Date
- Oct 2011
- Location
- New Jersey
- Posts
- 44
- Rep Power
- 0
Re: Too many compile errors in Windows command prompt, Can't see the first one
- 04-16-2012, 02:27 PM #9
Member
- Join Date
- Oct 2011
- Location
- New Jersey
- Posts
- 44
- Rep Power
- 0
Re: Too many compile errors in Windows command prompt, Can't see the first one
- 04-16-2012, 02:36 PM #10
Member
- Join Date
- Oct 2011
- Location
- New Jersey
- Posts
- 44
- Rep Power
- 0
Re: Too many compile errors in Windows command prompt, Can't see the first one
aha~ I found it after bit of googling.. "screen buffer size".. lol~ problem solved! Thanks Tolls!
- 04-16-2012, 02:55 PM #11
Re: Too many compile errors in Windows command prompt, Can't see the first one
I just tried what kjkrum suggested at #4 (after first commenting a variable declaration in a source file) and the error output was written to a file. Windows 7, Java 6.
If you're gettingJava Code:javac FileName.java 2> errors.txt
it looks like you put a dash (-) ahead of the 2.javac: invalid flag: 2
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 04-16-2012, 05:12 PM #12
Member
- Join Date
- Oct 2011
- Location
- New Jersey
- Posts
- 44
- Rep Power
- 0
Similar Threads
-
Coloured output in command prompt on windows using java
By tenlrt in forum Advanced JavaReplies: 2Last Post: 11-08-2011, 12:21 AM -
Letting my program command the command prompt
By Smokey. in forum Threads and SynchronizationReplies: 4Last Post: 03-29-2011, 11:34 PM -
First Java Program-Compile Errors (errors are posted)-simple GUI
By cc11rocks in forum AWT / SwingReplies: 4Last Post: 01-04-2011, 12:36 AM -
how to run windows command prompt in java parogram ?
By indikasampath2000 in forum AWT / SwingReplies: 4Last Post: 12-16-2008, 06:51 AM -
problem when I try to compile a program from command prompt
By osval in forum Advanced JavaReplies: 2Last Post: 08-06-2007, 09:16 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks