
JaVa CoDe
Senior Member

Jan 24, 2005, 3:37 AM
Post #1 of 2
(2200 views)
Shortcut
|
Online Java Tutorial
|
|
|
Contents * Instructions for the JXXX Compiler Service * Notes * Limitations * Commonly encountered Problems Instructions for the JXXX Compiler Service The form contains fields where you can enter the files you want compiled, plus some helper files; how you enter these depends on what browser you are using (see below). After entering the name(s) of your source-file(s) in the input fields and clicking on Compile you will get a page containing the standard output from the compiler (if any) and a link to the output-file(s) (if created); each output-file is deleted after being accessed. The link AllClasses.tar.gz will return a gzip'd tar file containing all the output-files. Similarly AllClasses.zip will return a zip file containing all class-files. Furthermore if you provide an html file in the Display File field then this file will be used to display the applet(s) you've just compiled. If you have a browser which understands a form input field of type=file and the encoding-type multipart/form-data (such as Netscape, version 2.0b2 and up) then you will see a "Browse..." button next to each input field. In this case just select the files you want to compile (one per field); the browser will then send the contents of those files along with the request. Alternatively you can of course enter the path to your file(s) by hand. Note: Do not enter a URL (if you want to give URLs in spite of your browsers upload capability, use the no-multipart form). If your browser doesn't understand this input type and encoding-type it will present you with a normal input field. In this case you must enter a URL where your file can be picked up (e.g. http://your.machine/your/file.java if you have a WWW server running on your machine, or ftp://your.machine/your/file.java if it can be accessed via ftp); the cgi-script will then use these URLs to get the files from your machine. Note: ftp URL's can be given a username and password in the form ftp://username:password@host/.... Of course this means you are sending your password to the script... (No, I don't log usernames or passwords, but short of giving you access to our machine I can't prove that). To view applets directly specify an html file in Display file. This file must contain at least the appropriate <APPLET >, <PARAM > and </APPLET> tags for each applet you want to view, and may contain anything else you wish too (so if you're preparing an applet for a specific page you can just use that page). The contents of the file will then be appended to the usual output generated by the scripts, with the CODEBASE attribute for each <APPLET > tag suitably munged. For more information on what the various options do see the Reference Pages. The Package file field enables you to compile files which require additional packages to the standard ones. In this field you can specify a jar file or an uncompressed zip file (zip -0) containing all the necessary packages. Note: be sure the directory structure is preserved, i.e. if you have a "import xyz.*;" and a "import abc.*;", then all the class files for package xyz must be in a subdirectory xyz, and all the class files for package abc must be in a subdirectory abc (use something like "zip -r0 packages.zip abc xyz" or "zip -0 packages.zip abc/*.class xyz/*.class" to zip them up, and then specify package.zip in the package input field). Notes If your browser can run applets then all files you don't pick up will be automagically deleted when you leave the page; if however your browser can't/won't run applets then please always either access all the output files listed (or AllClasses.tar.gz, AllClasses.zip) or click on the Delete All Files link; otherwise the files don't get removed from our system. I've compiled the compilers into a native exe's using j2c and Toba for the jdk-1.0.2 and jdk-1.1.7 javac, respectively. This speeds up compile times considerably. However there might be problems with the compiled compilers, so be sure to let me know if it doesn't work correctly (please also send the code that causes the problem). Limitations * You can compile a maximum of 5 files at a time (Netscape still seems to limit each field to one file). If you need to compile more than that at a time you can create your own version of this form locally with more input fields and use that to access the cgi-scripts for the compiler. * You need either a browser that understands an input field of type=file in forms and an encoding type multipart/form-data (such as Netscape 2.0b2 and up), or I have to be able to access your files via ftp, http or gopher. * /'s and \'s in the filename are assumed to be path specifiers and everything preceding the last / or \ is stripped; therefore these cannot be part of the filename. * When displaying your applets here there is a problem when those applets try to load images. Netscape security policies dictate that applets can only connect to the server from which they were loaded (in this case our site). If your applets try to load images from somewhere other than our site they will get a security exception and won't be started. To solve this for the simplest case where you need just one image, another field Image file has been added where you can specify an image file that will be put in the same place as your class files and that can therefore be loaded by the applet(s). Here too, if you need more image files then create your own version of this form locally with multiple image input fields (the cgi-script will handle an arbitrary number of input fields for any of the three types of input). Commonly encountered Problems * If your OS is Win 95 or NT and you're using Netscape 4.x then you must make sure you're running at least Netscape 4.02. Netscape 4.0 and 4.01 had a bug where they would uppercase the filenames (which would cause the compiler to complain, as the file name did not match the name of the public class anymore). * Many versions of MSIE are broken (so what's new?) and don't implement the multipart/form-data encoding correctly. I've worked around most errors, but some I just refuse to. I've noted that at least "MSIE 3.01; Mac_PowerPC" will fail - you'll see the error "Error: parts boundary not found in body". If you run into this, then please get a new version of the browser, or better yet, get something like Netscape which has always worked correctly (in this respect, anyways). * This service cannot be used to compile java class files into native exe's, nor will it handle javascript (javascript has nothing to do with java - it just happens to have a similar name). This service will only compile java source files into class files. * The source files must be in normal ascii text; do not try to use a word processor (such as Word) for writing java programs, as the output will contain formatting information which the compiler cannot understand. * Java source files must have the extension .java or .jav. Some editors on Win95 or NT (such as Notepad) seem to want to save files with the extension .txt. To solve this put the entire filename in quotes in the save dialog. Alternatively, you can first create an empty file with the .java extension and then edit that. * While the instructions above should be clear it bears repeating: if your browser does not support file uploads (i.e. no "Browse" button beside the input field) then we need to be able to access the source via ftp or http. Also, the URLs must be complete, absolute URLs (including the protocol). For example, the following are all invalid URLs: o file://my/file.java (file:// protocol not supported) o D:\Applets\CoolApplet.java (no protocol and no host specified) o CoolApplet.java (no protocol and no host specified) o www.somewhere.org/CoolApplet.java (no protocol specified) Some valid examples are: o http://my.server.dom/~fritz/CoolApplet.java o ftp://ftp.server.dom/pub/CoolApplet.java * When uploading large files be patient. Depending on the link this may take a few minutes. Also note that for instance Netscape will display the status Contacting host: www.innovation.ch while the data is being uploaded; i.e. status line is misleading here, since the server has already been contacted and the upload is in progress. Yes this is mine please dont steal.
_____________________________________________ ~Java Code (17:38:33) <%Brody> Xavier, Taz, and Athrin are like: You fags suck at internetting. (17:38:49) <%Brody> Ahh, go blow one, you intellectual
|