Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #4359

Re: Creating Archive Files in Eclipse with images.

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail
From Lew <noone@lewscanon.com>
Newsgroups comp.lang.java.programmer
Subject Re: Creating Archive Files in Eclipse with images.
Date Fri, 20 May 2011 09:13:39 -0400
Organization albasani.net
Lines 121
Message-ID <ir5pe1$fnc$1@news.albasani.net> (permalink)
References <97d85e5c-e75b-41d0-a967-02cdbf7b4913@q14g2000prh.googlegroups.com> <ir0jak$685$1@dont-email.me> <66251df5-1f5e-4cf7-9c86-3dac2a82b311@z13g2000prk.googlegroups.com> <ir3kkp$obm$1@dont-email.me> <bcdea7dc-328c-41c7-aa15-bd14f9b53a96@18g2000prd.googlegroups.com> <ir5ii9$vt9$1@news.albasani.net> <791a4586-8051-4373-89c5-97cca40f31fb@18g2000prd.googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace news.albasani.net FoOl37LaEeDT6wpFxWcDDxlgeFE2widVLjywFeOPPJ/72n/PSAfwBmwXR8bZj/tED5DWNo7fFvYHOVRoHh8BxJVOOpuBZFIUGz/N91Cp247mCJPS3nlbWywAfV5Gxjyc
NNTP-Posting-Date Fri, 20 May 2011 13:13:37 +0000 (UTC)
Injection-Info news.albasani.net; logging-data="EPcUWR94hzjfv3GQISq47h0nndbtE138kQjXL4bBVCx+5AnLrgSlCdYo/xGzIKqLW6XKZgnt4rXIjvN6MiCGKKktbHZsZeZMV8NpHI+Sq37WdTn1FEStyljef0FC1q9e"; mail-complaints-to="abuse@albasani.net"
User-Agent Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10
In-Reply-To <791a4586-8051-4373-89c5-97cca40f31fb@18g2000prd.googlegroups.com>
Cancel-Lock sha1:Y9irdUuoQ37MNkrypDhPEKqqI2Y=
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:4359

Show key headers only | View raw


ATTRIBUTE YOUR CITATIONS!

You've been around this newsgroup too long not to know better, Sanny.

Sanny wrote:
>>>     Problem writing /FightGame/fightgame.jardesc to JAR: duplicate
>>> entry: fightgame.jardesc

Lew wrote:
>> Don't include fightgame.jardesc in the JAR.  It's a development artifact and
>> has no place in the deployment.

Sanny [etc. - work it out]:
> I removed all unwanted files.

No, you didn't.  Apparently you are trying to include some unwanted files more 
than once.

> Still I am getting below errors.
>
> JAR creation failed. See details for additional information.
>    Problem writing /FightGame/META-INF/MANIFEST.MF to JAR: duplicate
> entry: META-INF/MANIFEST.MF
>    Problem writing /FightGame/HelloWorld.java to JAR: duplicate entry:
> HelloWorld.java

One does not normally include source in a JAR, or at least not in the 
deployment JAR.  Why do you wish to do so?

>    Problem writing /FightGame/META-INF/MANIFEST.MF to JAR: duplicate
> entry: META-INF/MANIFEST.MF
>    Resource /FightGame does not exist.
>    Resource /FightGame does not exist.
>    Resource /FightGame does not exist.

What is "Resource /FightGame"?

What did you set for it to try to include that?

Three times?

What else have you set to cause multiple attempts to write to the JAR?

Why are you including source?

>>> I have kept all my images in "src" folder. I find the jar do not add
>>> the content of "src" folder.

>> You usually don't include source in the deployment artifacts.

> "markspace" suggested me to create a src folder and put all images
> into that folder.

And nowhere did he tell you to include that folder in the JAR.  You made that 
part up.  Don't blame him for your behavior.

> I wanted some way to include all images and docs needed by the applet
> into a single .jar file.

It's not by including the "src" directory, it's by copying resources into the 
build directory, which Eclipse does automatically.  When resrources are in the 
designated source folders, Eclipse builds them into the JAR.

>>> How to ask the Eclipse to add all files from "src" folder into the
>>> jar [sic].

Questions should be phrased as interrogatives.

AFAIK it's enough to put the resource in the "src" folder tree, and Eclipse 
copies it.  I would have to check the Eclipse documentation for the details.

>> Why?
>
> So, that I get one .jar file instead of 20-30 images which takes
> longer to download.

That doesn't answer my question.  I asked why you wish to include the "src" 
directoy and you answered why you included specific image files.  Including 
the files makes perfect sense.

>>> It gives me no option to include a folder "src"

>> That's because it isn't part of the deployment.  Instead, it copies resources
>> FROM "src" to the build directory.

> Should I put the images into "lib" folder? Or I create a build folder.

No.  The Eclipse documentation explains how to set up a project.

> How can I suggest Eclipse to put all images into the .jar file?

RTFM.
<http://help.eclipse.org/helios/index.jsp>
<http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.jdt.doc.user/reference/ref-export-jar.htm>
<http://help.eclipse.org/helios/index.jsp>
<http://help.eclipse.org/helios/topic/org.eclipse.jdt.doc.user/reference/ref-properties-build-path.htm?resultof=%22%62%75%69%6c%64%22%20%22%61%70%70%6c%69%63%61%74%69%6f%6e%22%20%22%61%70%70%6c%69%63%22%20%22%4a%41%52%22%20%22%6a%61%72%22%20>

and more, found within a few minutes of a search through the Eclipse 
documentation online.

>>> When I double click the Jar [sic] a window opens for a few sec and closes
>>> without showing any error.

>> That's what the program does, apparently.

> No, This is a 2d fighting game When I use Run in eclipse it starts the
> 2d game. But when I click the .jar files the window opens for a few
> sec but then closes automatically. Without showing any error.

How do you know what it does?  You think the same program is called by the 
double-click as by Eclipse's action, but what is your evidence?

You draw a conclusion without looking at all the facts.

Appearing then disappearing when you double-click the JAR is either a failure 
to associate the .jar extension with "java -jar" or a problem internal to the JAR.

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Creating Archive Files in Eclipse with images. Sanny <softtanks22@hotmail.com> - 2011-05-18 05:16 -0700
  Re: Creating Archive Files in Eclipse with images. markspace <-@.> - 2011-05-18 06:58 -0700
    Re: Creating Archive Files in Eclipse with images. Sanny <softtanks22@hotmail.com> - 2011-05-19 10:20 -0700
      Re: Creating Archive Files in Eclipse with images. markspace <-@.> - 2011-05-19 10:39 -0700
        Re: Creating Archive Files in Eclipse with images. Sanny <softtanks22@hotmail.com> - 2011-05-20 02:20 -0700
          Re: Creating Archive Files in Eclipse with images. Lew <noone@lewscanon.com> - 2011-05-20 07:16 -0400
            Re: Creating Archive Files in Eclipse with images. Sanny <softtanks22@hotmail.com> - 2011-05-20 05:20 -0700
              Re: Creating Archive Files in Eclipse with images. Lew <noone@lewscanon.com> - 2011-05-20 09:13 -0400
                Re: Creating Archive Files in Eclipse with images. Sanny <softtanks22@hotmail.com> - 2011-05-20 07:17 -0700
                Re: Creating Archive Files in Eclipse with images. Lew <noone@lewscanon.com> - 2011-05-20 12:18 -0400
      Re: Creating Archive Files in Eclipse with images. Jeff Higgins <jeff@invalid.invalid> - 2011-05-19 14:03 -0400
      Re: Creating Archive Files in Eclipse with images. markspace <-@.> - 2011-05-19 11:10 -0700

csiph-web