4 Replies Latest reply: May 18, 2010 2:08 PM by 843804 RSS

    How to use utility jars without -cp

    843804
      I am trying to use a 3d loader from starfire research to load .3ds files. I currently have the jar in /lib/ext and netbeans sees this and uses it, and everything works perfectly fine. When I use this on other machines for a test, I put the 3d loader jar in to the client /lib/ext folder, but my program cannot find it. Any suggestions on where to put this jar without me having to use -cp every time?

      Thanks in advance.
        • 1. Re: How to use utility jars without -cp
          793415
          Welcome to the Sun forums.

          The basic answer to your question is to put the API on the application's run-time class-path. This can be done using the -cp option, a manifest, JWS, the applet archive element, placing the Jar in the WEB-INF/lib of a web application..

          To provide a more specific answer, would require (a lot) more information about the context.
          • 2. Re: How to use utility jars without -cp
            843804
            I'll try to explain better. The 3DS Loader I'm using is called StarfireExt.jar. I have two computers that I am using right now: a custom built desktop with Windows XP 32 bit that runs Netbeans, and a Dell laptop that I'm using to test my software. On the desktop, I have JDK1.6u18 with Java3D also installed. StarfireExt.jar is in my C:/Program Files/Java/jdk1.6.0_18/lib/ext/ folder, and Netbeans allows me to import and use StarfireExt. On the laptop, I have JRE1.6u20, Java3D, and StarfireExt in the lib/ext/ folder. When I'm on the desktop in Netbeans and press F6, it runs fine and the 3DS files load and are displayed. When I clean and build the JAR and move all of the models and JAR to my laptop, the program seems not able to find StarfireExt. The models don't load; no error windows that I've coded pop up.

            P.S. I'm sorry if I'm kind of a Java newbie. I don't know all those awesome developer tricks yet.
            • 3. Re: How to use utility jars without -cp
              793415
              trozamon wrote:
              I'll try to explain better. .. (big snip)
              Whoa, take a breath! I skimmed that mess of words and it did not seem to add anything I did not already know that was relevant. For example, I still don't know if this is intended to be a command line app. (no GUI), a servlet, applet, or rich client desk-top application. The ways of adding APIs to the run-time class path of an application (basically) break down along those lines.

              Try researching based on the keywords I gave you, and come back with a more focused question.
              ..P.S. I'm sorry if I'm kind of a Java newbie. ..
              In that case, I suggest that you have bitten off more than you can chew in taking on this project. Perhaps you should put it aside and come back to it later.
              • 4. Re: How to use utility jars without -cp
                843804
                I did like you suggested and looked in other forums.
                I'm really sorry for wasting your time.