Results 1 to 9 of 9
  1. #1
    tianchen is offline Member
    Join Date
    Jan 2014
    Posts
    34
    Rep Power
    0

    Default Question about Deployment

    Hi everyone,
    I am a student, who are doing a software project. The last step will be deploying the software as desktop exe for both windows and unix. I have no experience about it. So it would be so great if you can lend a hand on this.

    Question1 :

    my project has a folder structure like this:

    + Input file folder
    + configuration file folder
    + Output file folder
    + my project codes

    So my class in project codes should have proper access to the other three folders(input,output,config). Then what can I do to feed the function a relative path?How would that looks like?

    Question2:

    Is that true, for windows and unix I have to write two versions of codes on system-dependant path?

    Thank you very much for your time. Any suggestions and links will be welcome.

    best regards

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,792
    Rep Power
    25

    Default Re: Question about Deployment

    You should create a jar file that holds the program's parts. Properly written code packaged in a jar file should execute on any OS that has a JRE installed.
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,261
    Rep Power
    6

    Default Re: Question about Deployment

    Research 'java resources'.

    This article describes it specifically for .properties file, but the same trick works for any file you may want to load:

    Smartly load your properties | JavaWorld

    The swing documentation also mentions how to use it specifically for images:

    How to Use Icons (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  4. #4
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default Re: Question about Deployment

    You could use Maven to create your distribution package. Create a top-level POM with two child projects: one to build your app, and another to create a zip file containing your jar and directory structure. Then the user can just unzip it wherever they like. The zip file could include scripts for different platforms to start the program with the correct paths.
    Get in the habit of using standard Java naming conventions!

  5. #5
    zFollette is offline ▼ dafuq did I do?
    Join Date
    Dec 2013
    Posts
    203
    Rep Power
    0

    Default Re: Question about Deployment

    Check out JarSplice. It can do many things, among them, create launchers for windows, linux, and mac
    1000011 1100001 1101110 100000 1111001 1101111 1110101 100000 1110010 1100101 1100001 1100100 100000 1000010 1101001 1101110 1100001 1110010 1111001 111111

  6. #6
    tianchen is offline Member
    Join Date
    Jan 2014
    Posts
    34
    Rep Power
    0

    Default Re: Question about Deployment

    Thank you Norm, I have successfully distributed it by this way using exe4j.

  7. #7
    tianchen is offline Member
    Join Date
    Jan 2014
    Posts
    34
    Rep Power
    0

    Default Re: Question about Deployment

    thank you for your suggestions, gimbal :)

  8. #8
    tianchen is offline Member
    Join Date
    Jan 2014
    Posts
    34
    Rep Power
    0

    Default Re: Question about Deployment

    thank you kjkrum,
    your advices are always so helpful.

  9. #9
    tianchen is offline Member
    Join Date
    Jan 2014
    Posts
    34
    Rep Power
    0

    Default Re: Question about Deployment

    thank you for your time, zFollette :)

Similar Threads

  1. Deployment
    By horseatingweeds in forum New To Java
    Replies: 18
    Last Post: 11-16-2012, 11:06 PM
  2. jar Deployment
    By hsenpaws in forum New To Java
    Replies: 1
    Last Post: 06-26-2012, 07:35 PM
  3. Deployment
    By rob in forum Enterprise JavaBeans (EJB)
    Replies: 1
    Last Post: 04-08-2009, 11:03 PM
  4. hot deployment
    By Manas Das in forum Advanced Java
    Replies: 0
    Last Post: 01-21-2009, 06:24 PM
  5. deployment
    By Nicholas Jordan in forum NetBeans
    Replies: 4
    Last Post: 07-09-2008, 06:10 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
  •