Dos + Compiler

Status
Not open for further replies.
Hello all,

I am working on a Win98SE box and am compiling a Java program (1.3x). I have 2 questions:

1) When I compile using javac *.java in my dos window and get 100 or so errors, there is no way to scroll up and see what my 1st error was. So...Is there a way of adding scroll bars to the DOS window?

2) Is there a separate (free <-- very important) GUI compiler in which I can see or debug etc that you would recommend...?

Thank you very much

Regards,
hellfire
 

LlamaCebu

Smack-Fu Master, in training
84
Not sure why your re-direction to a file isn't working in DOS. I'm on a XP system so I don't want to go get something to work and then tell you to do it when it may or may not work in 98 (been a long time since I've done redirection in DOS). That being said, another way to redirect errors / system messages is within the Java program itself.

First you need a PrintStream:

code:<HR>
Code:
PrintStream errorLogPrintStream = null;<P>try
{
     errorLogPrintStream = new PrintStream(new BufferedOutputStream(new FileOutputStream("error_log.txt")), true);
}
catch(FileNotFoundException fnfe)
{
     //Add appropiate file not found error message.
     //Of course, you are creating the file, so it shouldn't ever be an issue..
}

Then you can set the output destination for various stuffs. Default is your console, but using the above printstream, it'll go to the error_log.txt file.

code:<HR>
Code:
System.setErr(errorLogPrintStream);   //For Java's error messages.
System.setOut(errorLogPrintStream);   //For any System.outs you may have.

This is useful if you deploy your app to other users as well. If they use the JRE and double click a .jar file instead of running it from the command prompt, they won't have a console window for error messages to go to. This way, it all goes to a file and if something borks, they can send you the file for bebugging.

Oh yeah, the about PrintStream won't append.. it overwrites. Just something to keep in mind.

-LlamaCebu

**EDIT- Yes, I'm a dumbass. I just realized that this does not help at all at compile-time errors. It's just good for run-time. I'll keep the post up anyhow.. maybe someone will find it useful.

[This message was edited by LlamaCebu on November 07, 2001 at 14:58.]
 

LlamaCebu

Smack-Fu Master, in training
84
Oh yeah.. when you say GUI compiler, does that mean you want the whole IDE, or just something that'll make compiling easier?

As far as IDEs, I honestly haven't found a good free one worth mentioning. Most of the free ones are written in Java, which imo, is a bad language to use for something as heavy as an IDE. To date, the best IDE I've used has been Kawa, but I just found out that Allaire isn't going to be making / supporting it anymore. I'm still going to use it, as it lets you use whatever JDK you want.. but it's kinda hard to recommend now that you can't get a hold of it.

Doing a search in here will probably yield a lot of IDE debates and maybe some good suggestions on free ones. Honestly, I haven't looked myself :D

-LlamaCebu
 

Rob the Placid

Wise, Aged Ars Veteran
105
If all you're looking for is a GUI for a compiler I'd recommend JEDPlus (you'll have to search for it, can't find it on the company's web page). One button to compile, one button to run; it also provides syntax highlighting and let's you save your Java code as HTML.

Edit: Oh, it can also automatically create an HTML page for you if youre working on Applets.
 
Status
Not open for further replies.