Results 1 to 2 of 2

Thread: my first Jar

  1. #1
    willemien is offline Member
    Join Date
    Apr 2010
    Location
    london UK
    Posts
    53
    Rep Power
    0

    Default my first Jar

    hi i wrote a program and now want to make a jar file from it,

    the program runs in Eclipse with run Run

    and am now wondering how to make a runnable Jar File of it.

    after choosing File-> export -> Java -> runnable Jar file
    i get a dialog with 3 options:

    1 -> Extract required Libraries into generated Jar
    2 -> package recruired libraries into generated jar
    3 -> Copy required libraries into a subfolder next to the generated Jar.

    my program only uses the standard Java libraries
    (including Swing and Awt, but not Swt or JFace)
    what should i choose and why?

    I do not want to distribute my sourcecode this time, how do i make sure only the compiled code is in the Jar?

    Thanks in Advance

  2. #2
    NotTooOld is offline Hostage
    Join Date
    Apr 2013
    Location
    China
    Posts
    128
    Rep Power
    0

    Default Re: my first Jar

    How about you just export the jar, and then look what's inside it? My experience has been that Eclipse only exports what is needed. You will have to choose a configuration to use for the export, but that should be easy enough if you've run the file from the "Run" menu.

    Oh, I see now what you're getting at. I think anyone with a JDK may be able to open and see your code. There may (probably is) a way to set a password on your .class file, but I have no idea how. I just tried on my computer and could only see the compiled bits, but I'm no computer expert. Eclipse wouldn't open it either. You may be fine.
    Last edited by NotTooOld; 04-20-2013 at 12:06 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
  •