Problems exporting an application with Eclipse

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bruceski
    New Member
    • Mar 2007
    • 2

    #1

    Problems exporting an application with Eclipse

    Hello all,
  • Bruceski
    New Member
    • Mar 2007
    • 2

    #2
    Problems exporting an application with Eclipse

    Hello all,
    I wrote an application with eclipse that uses Java3d and Jlayer, which is a simple MP3 player. The application is a demo to help visualize matrices in more than 3 dimensions, and basically is an animation with a series of box structures. I am now finished with the application and am trying to make it into something portable and easily distributed, and I thought the easiest way to do it was producing an executable jar file.

    I made a jar file with a manifest using the wizard in Eclipse. But it does not execute when double clicked. I tried to run it via command line to get some debugging, and I have found 2 problems that I am not sure how to resolve.

    1. I have a lot of resource files (texture files, mp3's etc) that are used in the application. These are just thrown in the root of the project folder. For running the application within eclipse, I can access these files with just a string name and it works fine, but when I turn the entire project into a jar file and run it via the command line or double clicking it, the resource files cannot be found. How do I link the resource files so they will be accessible within this jar file?

    2. I am using two external libraries, java3d and jlayer 1.0. I followed the instructions for inserting these libraries into my project, but it seems that the program can only run if these libraries are inserted into the PATH and/or CLASSPATH for the user and system environment variables. (so the linking inside the project may not be working). I want these libraries to work within the jar file so they don't have to be individually installed on the system.

    The Websites:



    Its actually a separate situation for each library:

    JLayer seems to work fine just being referenced within the eclipse project, but cannot be run from the command line without it being referenced as a system CLASSPATH. With Jlayer I imported a class folder to reference it.

    With Java3d it seems that it has to be a system environment variable for it to run either in eclipse or command line. With Java3d there was no class folder, so I referenced and copied the .jar files according to instructions from j3d.org.

    I need these libraries to be used within the jar file so users don't have to download the libraries separately.

    A possible solution is making this application distributable another way. Any suggestions? I tried an applet originally, but its pretty big (20 megs) and I had trouble implementing it. I also looked in to making an executable shell and Java web start, but with no initial luck.

    The source code is available on request, I can post a RapidShare link. This is not for a class, but an independent research project that is non-profit, so any help I get will be properly cited.

    I apologize for the length!


    Microsoft XP Professional SP 2 2002
    Java JRE 1.6.0
    Java JDK 1.6.0
    Eclipse 3.2
    Last edited by Bruceski; Mar 1 '07, 04:09 AM. Reason: grammar error

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      Originally posted by Bruceski
      Hello all,
      I wrote an application with eclipse that uses Java3d and Jlayer, which is a simple MP3 player. The application is a demo to help visualize matrices in more than 3 dimensions, and basically is an animation with a series of box structures. I am now finished with the application and am trying to make it into something portable and easily distributed, and I thought the easiest way to do it was producing an executable jar file.

      I made a jar file with a manifest using the wizard in Eclipse. But it does not execute when double clicked. I tried to run it via command line to get some debugging, and I have found 2 problems that I am not sure how to resolve.

      1. I have a lot of resource files (texture files, mp3's etc) that are used in the application. These are just thrown in the root of the project folder. For running the application within eclipse, I can access these files with just a string name and it works fine, but when I turn the entire project into a jar file and run it via the command line or double clicking it, the resource files cannot be found. How do I link the resource files so they will be accessible within this jar file?

      2. I am using two external libraries, java3d and jlayer 1.0. I followed the instructions for inserting these libraries into my project, but it seems that the program can only run if these libraries are inserted into the PATH and/or CLASSPATH for the user and system environment variables. (so the linking inside the project may not be working). I want these libraries to work within the jar file so they don't have to be individually installed on the system.

      The Websites:



      Its actually a separate situation for each library:

      JLayer seems to work fine just being referenced within the eclipse project, but cannot be run from the command line without it being referenced as a system CLASSPATH. With Jlayer I imported a class folder to reference it.

      With Java3d it seems that it has to be a system environment variable for it to run either in eclipse or command line. With Java3d there was no class folder, so I referenced and copied the .jar files according to instructions from j3d.org.

      I need these libraries to be used within the jar file so users don't have to download the libraries separately.

      A possible solution is making this application distributable another way. Any suggestions? I tried an applet originally, but its pretty big (20 megs) and I had trouble implementing it. I also looked in to making an executable shell and Java web start, but with no initial luck.

      The source code is available on request, I can post a RapidShare link. This is not for a class, but an independent research project that is non-profit, so any help I get will be properly cited.

      I apologize for the length!


      Microsoft XP Professional SP 2 2002
      Java JRE 1.6.0
      Java JDK 1.6.0
      Eclipse 3.2
      Specify the classpath in the manifest for the jar. See here for how to do that.

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by Bruceski
        Hello all,
        Do not double post

        Comment

        • r035198x
          MVP
          • Sep 2006
          • 13225

          #5
          Also go through this.

          Comment

          Working...