jar question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christof Laeremans

    jar question

    Hello,

    I'm trying to write an applet that shows the exif information of a jpeg
    image. For displaying this information I'm going to use the classes
    found on this website http://www.drewnoakes.com/code/exif/.

    But, they are in an jar file. Is there a way to import this jar file
    into my applet so I can use the classes and methods for getting this
    information?

    Thanks,

    Christof Laeremans

  • Neomorph

    #2
    Re: jar question

    On Mon, 01 Sep 2003 20:40:15 +0200, Christof Laeremans
    <christof_nospa m_laeremans@yah oo_againnospam_ co.uk> two-finger typed:
    [color=blue]
    >Hello,
    >
    >I'm trying to write an applet that shows the exif information of a jpeg
    >image. For displaying this information I'm going to use the classes
    >found on this website http://www.drewnoakes.com/code/exif/.
    >
    >But, they are in an jar file. Is there a way to import this jar file
    >into my applet so I can use the classes and methods for getting this
    >information?[/color]

    Although, officially you can add more than one JAR file into the ARCHIVE
    tag of the APPLET tag (or the ARCHIVE parameter of the OBJECT tag), you
    could also:
    1) unJAR the classes and JAR your classes together with the Exim classes
    for a single JAR file.
    2) only reference the Exim JAR file with ARCHIVE, and put your own classes
    unarchived into the site.
    [color=blue]
    >
    >Thanks,
    >
    >Christof Laeremans[/color]

    Cheers.

    Comment

    • Christof Laeremans

      #3
      Re: jar question

      Neomorph wrote:[color=blue]
      > On Mon, 01 Sep 2003 20:40:15 +0200, Christof Laeremans
      > <christof_nospa m_laeremans@yah oo_againnospam_ co.uk> two-finger typed:
      >
      >[color=green]
      >>Hello,
      >>
      >>I'm trying to write an applet that shows the exif information of a jpeg
      >>image. For displaying this information I'm going to use the classes
      >>found on this website http://www.drewnoakes.com/code/exif/.
      >>
      >>But, they are in an jar file. Is there a way to import this jar file
      >>into my applet so I can use the classes and methods for getting this
      >>information ?[/color]
      >
      >
      > Although, officially you can add more than one JAR file into the ARCHIVE
      > tag of the APPLET tag (or the ARCHIVE parameter of the OBJECT tag), you
      > could also:
      > 1) unJAR the classes and JAR your classes together with the Exim classes
      > for a single JAR file.
      > 2) only reference the Exim JAR file with ARCHIVE, and put your own classes
      > unarchived into the site.
      >
      >[color=green]
      >>Thanks,
      >>
      >>Christof Laeremans[/color]
      >
      >
      > Cheers.[/color]

      Hello,

      So, I've created my java applet and imported it in an HTML file with the
      applet tag

      <applet
      archive = "photoexif/metadata-extractor-2.1.jar"
      code = "photoexif/Exif.class"
      name = "TestApplet "
      width = "400"
      height = "20"
      hspace = "0"
      vspace = "0"
      align = "middle"[color=blue]
      >[/color]
      </applet>

      But, the only thing I see is a gray bar with no text. When I start the
      applet with JBuilder I can see the exif off the selected photo.

      What is wrong ?

      Regards,

      Christof Laeremans


      Comment

      • Neomorph

        #4
        Re: jar question

        (See below)

        On Wed, 03 Sep 2003 08:44:09 +0200, Christof Laeremans
        <christoflaerem ans_nospam_@yah oo_nospam.co.uk > two-finger typed:[color=blue]
        >Neomorph wrote:[color=green]
        >> On Mon, 01 Sep 2003 20:40:15 +0200, Christof Laeremans
        >> <christof_nospa m_laeremans@yah oo_againnospam_ co.uk> two-finger typed:[color=darkred]
        >>>But, they are in an jar file. Is there a way to import this jar file
        >>>into my applet so I can use the classes and methods for getting this
        >>>informatio n?[/color]
        >>
        >> Although, officially you can add more than one JAR file into the ARCHIVE
        >> tag of the APPLET tag (or the ARCHIVE parameter of the OBJECT tag), you
        >> could also:
        >> 1) unJAR the classes and JAR your classes together with the Exim classes
        >> for a single JAR file.
        >> 2) only reference the Exim JAR file with ARCHIVE, and put your own classes
        >> unarchived into the site.
        >> [/color]
        >So, I've created my java applet and imported it in an HTML file with the
        >applet tag
        >
        ><applet
        > archive = "photoexif/metadata-extractor-2.1.jar"
        > code = "photoexif/Exif.class"[/color]

        You can't add a path to the class in the CODE tag, you need to set the
        codebase, instead:

        codebase="photo exif"
        archive = "metadata-extractor-2.1.jar" <!-- from codebsae -->
        code = "Exif.class " <!-- from codebsae -->
        [color=blue]
        > name = "TestApplet "
        > width = "400"
        > height = "20"
        > hspace = "0"
        > vspace = "0"
        > align = "middle"[color=green]
        > >[/color]
        ></applet>
        >
        >But, the only thing I see is a gray bar with no text. When I start the
        >applet with JBuilder I can see the exif off the selected photo.[/color]

        The tags cannot be used that easily, they have very specific functions of
        their own.

        I'm quite interested in Exif - isn't it an extension to JPG that adds
        information about how the image was taken ?


        Cheers.

        Comment

        • Christof Laeremans

          #5
          Re: jar question

          Neomorph wrote:[color=blue]
          > (See below)
          >
          > On Wed, 03 Sep 2003 08:44:09 +0200, Christof Laeremans
          > <christoflaerem ans_nospam_@yah oo_nospam.co.uk > two-finger typed:
          >[color=green]
          >>Neomorph wrote:
          >>[color=darkred]
          >>>On Mon, 01 Sep 2003 20:40:15 +0200, Christof Laeremans
          >>><christof_no spam_laeremans@ yahoo_againnosp am_co.uk> two-finger typed:
          >>>
          >>>>But, they are in an jar file. Is there a way to import this jar file
          >>>>into my applet so I can use the classes and methods for getting this
          >>>>information ?
          >>>
          >>>Although, officially you can add more than one JAR file into the ARCHIVE
          >>>tag of the APPLET tag (or the ARCHIVE parameter of the OBJECT tag), you
          >>>could also:
          >>>1) unJAR the classes and JAR your classes together with the Exim classes
          >>>for a single JAR file.
          >>>2) only reference the Exim JAR file with ARCHIVE, and put your own classes
          >>>unarchived into the site.
          >>>[/color]
          >>
          >>So, I've created my java applet and imported it in an HTML file with the
          >>applet tag
          >>
          >><applet
          >> archive = "photoexif/metadata-extractor-2.1.jar"
          >> code = "photoexif/Exif.class"[/color]
          >
          >
          > You can't add a path to the class in the CODE tag, you need to set the
          > codebase, instead:
          >
          > codebase="photo exif"
          > archive = "metadata-extractor-2.1.jar" <!-- from codebsae -->
          > code = "Exif.class " <!-- from codebsae -->
          >[color=green]
          >> name = "TestApplet "
          >> width = "400"
          >> height = "20"
          >> hspace = "0"
          >> vspace = "0"
          >> align = "middle"
          >>
          >></applet>
          >>
          >>But, the only thing I see is a gray bar with no text. When I start the
          >>applet with JBuilder I can see the exif off the selected photo.[/color]
          >
          >
          > The tags cannot be used that easily, they have very specific functions of
          > their own.
          >
          > I'm quite interested in Exif - isn't it an extension to JPG that adds
          > information about how the image was taken ?
          >
          >
          > Cheers.[/color]

          Hello,

          I'm going to try that. The exif is indeed an extension for JPG. the
          applet works great in my JBuilder IDE (and hopefully now in my bowser ;) )

          Regards,

          Christof Laeremans

          Comment

          • seb

            #6
            Re: jar question

            Christof Laeremans <christof_nospa m_laeremans@yah oo_againnospam_ co.uk> wrote in message news:<bj042l$3o [email protected] s.nl>...[color=blue]
            > Hello,
            >
            > I'm trying to write an applet that shows the exif information of a jpeg
            > image. For displaying this information I'm going to use the classes
            > found on this website http://www.drewnoakes.com/code/exif/.
            >
            > But, they are in an jar file. Is there a way to import this jar file
            > into my applet so I can use the classes and methods for getting this
            > information?
            >
            > Thanks,
            >
            > Christof Laeremans[/color]


            a jar is the same thing that a group of .class files. You can also
            rename it with the zip extention an extract .class files.

            Comment

            • Mark McKay

              #7
              Re: jar question

              seb wrote:
              [color=blue]
              > Christof Laeremans <christof_nospa m_laeremans@yah oo_againnospam_ co.uk> wrote in message news:<bj042l$3o [email protected] s.nl>...
              >[color=green]
              >>Hello,
              >>
              >>I'm trying to write an applet that shows the exif information of a jpeg
              >>image. For displaying this information I'm going to use the classes
              >>found on this website http://www.drewnoakes.com/code/exif/.
              >>
              >>But, they are in an jar file. Is there a way to import this jar file
              >>into my applet so I can use the classes and methods for getting this
              >>information ?
              >>
              >>Thanks,
              >>
              >>Christof Laeremans[/color]
              >
              >
              >
              > a jar is the same thing that a group of .class files. You can also
              > rename it with the zip extention an extract .class files.[/color]

              A better way to do this is to include the jar in your classpath. Timply
              type:

              java -cp c:\path\to\my\j ar\file\thejarf ile.jar MyMainClass

              and your application will include the files in the jarfile when it
              executes. There is a similar syntax for javac, and you can include
              second party jars this way for applets and web start applications too.

              I would definately not recommend unzipping the jar and using the .class
              files directly.

              Lots more on jars, including use of the manifest file, can be found at
              Sun's tutorial site:




              Mark McKay

              Comment

              Working...