🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Java CGI fixes

Published December 28, 1999
Advertisement
Well, I finally figured out the problem I was having running Java as a CGI. Turns out it was two things. Sun being too nitpicky about command-line parameters, and Microsoft doing some cheating to wring a few extra clock-cycles out of their benchmarks.

Basically, I had two choices for a VM to run my Java app, the official Sun Java interpreter and Microsoft JView. The Sun version was not a good choice because of some boneheadedness on their part. When I told the web server I wanted to run Server.class, it passes the full name of the file to Sun's VM. Unfortunately, the first thing Sun's VM does is append .class to your file, and the program complains that it can't find Server.class.class. Boy, you'd think that after four years, Sun could write a decent command-line parser.

Microsoft, on the other hand, shot themselves in the foot trying to speed up their benchmarks. Rather than just sending streams to standard output, they write directly to the screen buffers. This is slightly faster than using streaming I/O, but it completely screws things up for CGI's, which communicate to and from the server via standard streams. That's why I was getting a blank screen whenever I tried to run my Java CGI.

For the time being, I fixed the problem by making a .BAT file that runs the Sun interpreter, passing the .class file to it. I dunno yet how it works with input. If it does, that should solve my problems.
Previous Entry fixing things
Next Entry Goodbye forever!
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement