Menu

jar not including images and html file

Help
2008-11-14
2013-05-20
  • Christiane Guise

    I have a project with GUI which includes a folder myFiles with images and Html
    all work fine but when I click on the jar the GUI starts but with no images
    I do not know where I go wrong
    the project is as follow

    BookOfChanges
              src

     
    • Christiane Guise

      Sorry here is the project in brief as it is much longer the aim is to be able to put it on a cd so it can run outside eclipse
      bookProject
      src
                 package myBook
                        main.class
                 myFiles
                        book.gif

      all appear in a GUI
            
      this is y build.xml
      <?xml version="1.0" encoding="UTF-8" ?>
      <project default="jar">

          <!-- Compile and zip the source code into a jar -->
          <target name="jar">

              <!-- Make the folders we'll need -->
              <mkdir dir="ant"/>
              <mkdir dir="work"/>

              <!--
              Compile all the .java files into .class files

              debug = yes        Include debug information in the .class files
              destdir            Where to put the .class files
              source and target  Use Java version 1.6.0_06
              -->
              <javac
                  debug="yes"
                  destdir="ant"
                  source="1.6"
                  target="1.6">

                  <!-- Folders that have trees of .java files to compile -->
                  <src path="src"/>
              </javac>
        <!--
              Zip files together to make a jar

              jarfile          Where to make the .jar file, overwrite something there
              basedir          Find the files to zip in the jar here
              filesonly = yes  Store only file entries
              -->

              <jar
                  jarfile="work/BookProject.jar"
                  basedir="ant"
                  filesonly="yes"
             >
                  
                  <!-- Write a manifest inside the jar -->
                  <manifest>

                      <!-- The class Java will run when the user double-clicks the jar -->
                      <attribute name="Main-Class" value="myBook.Main"/>
                                     
                  </manifest>
              </jar>
          </target>
      </project>

      the problem is that in the Work folder containing the BookProject.jar (the executable jar)
      the GUI works but without images while the application works very well with images
      I have tried so many things I hope you can help me

       

Log in to post a comment.