Results 1 to 4 of 4
  1. #1
    javment is offline Member
    Join Date
    Oct 2010
    Posts
    6
    Rep Power
    0

    Default Xuggle and enviroment variables

    Hello,
    I want to create an application for playing video. I choose to use xuggle wraper for ffmpeg for decoding the video. I import the jar files of xuggle. Another step that needs to use the xuggle is to set three environment variables, for example $ XUGGLE_HOME = / usr / local / xuggle. When I do this and run the eclipse from the same terminal set env variables everything is okay.

    But how can I create an executable jar, which can run on other machines with the JRE, you do not have to rearrange the variables env;

    Thank you.

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,574
    Rep Power
    12

    Default

    It seems that there are two things your jar file is going to have to:

    (1) Make sure that the xuggle resources are available. Executable jar files provide a mechanism for specifying the path of resources they need. See Adding Classes to the JAR File's Classpath in Oracle's Tutorial. The whole section may be useful.

    (2) Make sure that the required environment variables are set correctly. You could do this in a shell script that launches the jar. Or you could include this information as part of what the user does to install the program. The latter approach has the advantage that you are not unilaterally deciding where the user puts xuggle's home.

  3. #3
    javment is offline Member
    Join Date
    Oct 2010
    Posts
    6
    Rep Power
    0

    Default

    pbrockway2 thank you for your answer.

    With the first thing all is okay. The problem is in the second. As I told in the first post I can set the environment variables correctly and all is ok in the development state. But When i want to send the executable jar with the libs folder for example to a friend pc to run, this did not work cause the environment vars. To create an .sh(linux) or a .bat(windows) file to set the variables and after run the "java -jar executable.jar" is good idea, but is this requires my friend (for example) to have the xuggle folder somewhere on his pc and I have to know where is it so I can set the variables?

    Is a possible solution to create an other simple executable jar file, like an installer to copy the xuggle folder for example in the home folder of the user and after set the variables correctly?




    Thank you again.

  4. #4
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,574
    Rep Power
    12

    Default

    You could try and write your own, but there are installers which check for required dependencies, copy them if required and set environment variables, registry settings, desktop menus etc. Sorry, I have no experience with them - but others here are sure to. Or Google.

Similar Threads

  1. What are Instance variables and static variables?
    By sandeshforu in forum New To Java
    Replies: 3
    Last Post: 09-09-2009, 06:48 PM
  2. Replies: 5
    Last Post: 08-26-2009, 12:59 PM
  3. Help with muliplying two variables
    By michael.dunkling in forum New To Java
    Replies: 12
    Last Post: 07-18-2008, 10:22 PM
  4. Variables
    By mew in forum New To Java
    Replies: 3
    Last Post: 12-11-2007, 01:44 PM
  5. variables-methods
    By Warren in forum New To Java
    Replies: 1
    Last Post: 11-28-2007, 05:14 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •