Results 1 to 5 of 5
  1. #1
    yuji007 is offline Member
    Join Date
    Jan 2012
    Posts
    2
    Rep Power
    0

    Lightbulb Please help me Error java..!!!!!!!!

    Script Java :

    Java 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
    The results of the script above
    Please help me Error java..!!!!!!!!-tes.png

    what causes the above error system...????, please help me just learning java programming....

    Thanks Your Atention.....
    Last edited by Eranga; 01-06-2012 at 04:39 AM. Reason: code tags added

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default Re: Please help me Error java..!!!!!!!!

    How did you run the program?

    In particular you should do what the message says and run

    Java Code:
    java Image2HTML -usage
    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.

    -----

    Just my 2c, but I think you would learn Java better and faster by writing your own code.

  3. #3
    yuji007 is offline Member
    Join Date
    Jan 2012
    Posts
    2
    Rep Power
    0

    Default Re: Please help me Error java..!!!!!!!!

    Ok thanks Your Atention....

  4. #4
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default Re: Please help me Error java..!!!!!!!!

    You're welcome.

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default 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

  1. Replies: 0
    Last Post: 01-21-2011, 01:43 PM
  2. Replies: 5
    Last Post: 08-13-2010, 11:04 AM
  3. java out of memory error-heap space error
    By elsanthosh in forum NetBeans
    Replies: 4
    Last Post: 06-15-2010, 10:31 AM
  4. Replies: 1
    Last Post: 12-05-2009, 08:28 AM
  5. Replies: 1
    Last Post: 10-26-2009, 05:38 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •