Results 1 to 5 of 5
- 01-05-2012, 11:59 PM #1
Member
- Join Date
- Jan 2012
- Posts
- 2
- Rep Power
- 0
Please help me Error java..!!!!!!!!
Script Java :
The results of the script aboveJava Code:// This is the main class of Image2HTML. It handle the command line. // // Version 2007-02-25 changes: // * Added support for image quantization (with -quantize N) using JIU // * Improved class name selection to use base 26 for first digit and base 36 for remaining digits. // // Version 2007-01-31 changes: // * Added support for vaguely JPEG-like compression tolerance, with -tolerance // * Added support for CSS to increase compression. // public class Image2HTML { static Preferences prefs; public static void main(String args[]) { System.out.println("main()"); // Parse the command line prefs = new Preferences(); for (int i = 0; i < args.length; i++) { if (args[i].equalsIgnoreCase("-url")) { prefs.urlString = args[i+1]; i++; } else if (args[i].equalsIgnoreCase("-tofile")) { prefs.toFile = args[i+1]; i++; } else if (args[i].equalsIgnoreCase("-xscale")) { prefs.xscale = Integer.parseInt(args[i+1]); i++; } else if (args[i].equalsIgnoreCase("-yscale")) { prefs.yscale = Integer.parseInt(args[i+1]); i++; } else if (args[i].equalsIgnoreCase("-border")) { prefs.border = Integer.parseInt(args[i+1]); i++; } else if (args[i].equalsIgnoreCase("-cellspacing")) { prefs.cellspacing = Integer.parseInt(args[i+1]); i++; } else if (args[i].equalsIgnoreCase("-tolerance")) { prefs.tolerance = Integer.parseInt(args[i+1]); i++; } else if (args[i].equalsIgnoreCase("-quantize")) { prefs.quantizeNumberOfColors = Integer.parseInt(args[i+1]); i++; } else if (args[i].equalsIgnoreCase("-nospacers")) { prefs.spacers = false; } else if (args[i].equalsIgnoreCase("-notopgrid")) { prefs.topGrid = false; } else if (args[i].equalsIgnoreCase("-tableonly")) { prefs.fullpage = false; } else if (args[i].equalsIgnoreCase("-compress")) { prefs.compress = true; } else if (args[i].equalsIgnoreCase("-css")) { prefs.css = true; } else if (args[i].equalsIgnoreCase("-cgi")) { prefs.cgi = true; } else { System.out.println("usage: java Image2HTML -url {URL}"); System.out.println(" [-tofile {pathname}]"); System.out.println(" [-xscale {integer}]"); System.out.println(" [-yscale {integer}]"); System.out.println(" [-compress]"); System.out.println(" [-border {integer}]"); System.out.println(" [-cellspacing {integer}]"); System.out.println(" [-nospacers]"); System.out.println(" [-tableonly]"); System.out.println(" [-notopgrid]"); System.out.println(" [-cgi]"); System.out.println(" [-css]"); System.out.println(" [-quantize {integer}]"); System.out.println("invalid arg: " + args[i]); System.exit(0); } // usage error } // for args // System.out.println("1"); if (prefs.urlString == null) { System.out.println("You must specify an url; use -usage to see usage"); System.exit(-1); } // Get and process the image // System.out.println("Creating ImageFetcher"); ImageFetcher imageFetched = new ImageFetcher(prefs); // System.out.println("Created ImageFetcher"); } // main() static public void ErrorExit(String errorMsg) { // In CGI mode, we send everything to stdout if (prefs.cgi) System.out.println("Error: " + errorMsg); else System.err.println("Error: " + errorMsg); System.exit(-1); } //==== ErrorExit() ====// } // class Image2HTML

what causes the above error system...????, please help me just learning java programming....
.gif)
Thanks Your Atention.....
Last edited by Eranga; 01-06-2012 at 03:39 AM. Reason: code tags added
- 01-06-2012, 12:13 AM #2
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,547
- Rep Power
- 11
Re: Please help me Error java..!!!!!!!!
How did you run the program?
In particular you should do what the message says and run
and see what it says. The program is evidently supposed to have a url used as an argument. It's impossible to give you an example of what a correct url would be without knowing what the rest of the code does. Perhaps you should also read whatever documentation came with the software.Java Code:java Image2HTML -usage
-----
Just my 2c, but I think you would learn Java better and faster by writing your own code.
- 01-06-2012, 12:21 AM #3
Member
- Join Date
- Jan 2012
- Posts
- 2
- Rep Power
- 0
Re: Please help me Error java..!!!!!!!!
Ok thanks Your Atention....
- 01-06-2012, 12:25 AM #4
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,547
- Rep Power
- 11
Re: Please help me Error java..!!!!!!!!
You're welcome.
- 01-06-2012, 03:41 AM #5
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Re: Please help me Error java..!!!!!!!!
@OP, please use the code tags when you are posting code segments in the forum. Unformated codes are really hard to read.
Similar Threads
-
java.sql.SQLException: System or internal error java.io.IOException: Stream closed
By ashok bhagat in forum Advanced JavaReplies: 0Last Post: 01-21-2011, 12:43 PM -
how to solve this ERROR --java.lang.OutOfMemoryError: Java heap space
By krunalpatel1410 in forum New To JavaReplies: 5Last Post: 08-13-2010, 10:04 AM -
java out of memory error-heap space error
By elsanthosh in forum NetBeansReplies: 4Last Post: 06-15-2010, 09:31 AM -
Thread: Error 500--Internal Server Error java.lang.NullPointerException
By jackdear44 in forum New To JavaReplies: 1Last Post: 12-05-2009, 07:28 AM -
java.lang.Error: Error opening DSound for capture
By NARs in forum NetworkingReplies: 1Last Post: 10-26-2009, 04:38 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks