Jump to content
Site Stability Read more... ×
  • Advertisement
  • entries
  • comments
  • views

Java CGI fixes

Sign in to follow this  


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.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!