Results 1 to 4 of 4
  1. #1
    JohnST is offline Member
    Join Date
    Dec 2009
    Posts
    20
    Rep Power
    0

    Question creating executable .jar for linux, mac, and windows

    I made an executable .jar in Windows and if I put these files in the same folder it works fine.

    Java Code:
    vrem.jar
    images/background.png
    config.properties
    When I try to execute this in Ubuntu it does not load the background image and the config.properties.

    I added this to manifest
    Java Code:
    Class-Path:config.properties
    but still did'nt load config.properties. I didn't even try the Image folder since config.properties didn't work.

    Is there a way to make an executable .jar that is windows, mac and pc friendly? I would like to leave config.properties and Image directory seperate from .jar

    background image:
    Java Code:
    background = new ImageIcon("images/home_background.png");
    This is what I use to load config.properties:
    Java Code:
    configFile.load(new FileInputStream("config.properties"));

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  3. #3
    JohnST is offline Member
    Join Date
    Dec 2009
    Posts
    20
    Rep Power
    0

    Default

    I thought it would be easier for others to edit config.properties and change out images when I distribute it.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    if you use java std properties you shouldn't have to worry about this. see link: properties

Similar Threads

  1. Need help for creating executable xml
    By patilsubh in forum XML
    Replies: 3
    Last Post: 10-01-2009, 11:54 AM
  2. Replies: 3
    Last Post: 08-10-2009, 07:34 AM
  3. Replies: 6
    Last Post: 04-08-2009, 05:05 AM
  4. Character encoding in Java (Linux to Windows)
    By BeholdMyGlory in forum New To Java
    Replies: 2
    Last Post: 01-16-2009, 07:24 PM
  5. Access Linux shared folder from Windows OS
    By nitinpjairaj in forum Networking
    Replies: 3
    Last Post: 08-26-2008, 07:14 PM

Posting Permissions

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