Results 1 to 13 of 13
  1. #1
    Join Date
    Jan 2010
    Posts
    72
    Rep Power
    0

    Default packing java project

    I have made a java project and want to deliver it to a client but I don't want to deliver it as a jar file as the client can see the source code easily by unpacking the jar file.

    How can I pack my java project so client cannot look at the source code or cannot change the source code?

    One more thing, Can I integrate a key functionality so that client can only access that software by first registering it with the key provided by me?

    Second, can I integrate another functionality through which the software can run only on a single machine through that key?

    Any suggestion will be highly appreciated

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,375
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by silversurfer2in View Post
    I have made a java project and want to deliver it to a client but I don't want to deliver it as a jar file as the client can see the source code easily by unpacking the jar file.
    The solution is simple: don't pack your sources in that .jar file.

    kind regards,

    Jos

  3. #3
    Join Date
    Jan 2010
    Posts
    72
    Rep Power
    0

    Default

    Then what to do...

  4. #4
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,375
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by silversurfer2in View Post
    Then what to do...
    What wasn't clear in my previous reply?

    kind regards,

    Jos

  5. #5
    Join Date
    Jan 2010
    Posts
    72
    Rep Power
    0

    Default

    please elaborate it....if i won't be putting my source files in the jar file then how will it be going to work...and what about putting license key on the project...please explain

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,856
    Rep Power
    19

    Default

    You put your compiled class files in the jar maybe?

  7. #7
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    5

    Default

    Quote Originally Posted by silversurfer2in View Post
    How can I pack my java project so client cannot look at the source code or cannot change the source code?

    usually a java-project have a subfolder called src for sources and a subfolder called bin which contains the compiled byte-code of each class-file. so when you have to deliver your code then deliver only the bin directory. in addition

    The basic format of the command for creating a JAR file is:

    jar cf jar-file input-file(s)

    The options and arguments used in this command are:

    * The c option indicates that you want to create a JAR file.
    * The f option indicates that you want the output to go to a file rather than to stdout.
    * jar-file is the name that you want the resulting JAR file to have. You can use any filename for a JAR file. By convention, JAR filenames are given a .jar extension, though this is not required.
    * The input-file(s) argument is a space-separated list of one or more files that you want to include in your JAR file. The input-file(s) argument can contain the wildcard * symbol. If any of the "input-files" are directories, the contents of those directories are added to the JAR archive recursively.

    if you have all your files in the same directory, then note that "The input-file(s) argument can contain the wildcard * symbol." so select only your class-files. for more details, read this
    Last edited by j2me64; 06-08-2010 at 05:35 PM.

  8. #8
    Join Date
    Jan 2010
    Posts
    72
    Rep Power
    0

    Default

    @j2me64

    thanx a lot....
    please help me in implementing the functionality of putting a license key....

  9. #9
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    my source files in the jar file then how will it be going to work
    There is a basic problem here understanding the relationship between source files and the output of a compiler.

  10. #10
    Lil_Aziz1's Avatar
    Lil_Aziz1 is offline Senior Member
    Join Date
    Dec 2009
    Location
    United States
    Posts
    343
    Rep Power
    5

    Default

    People/programs can read files with the extension .java
    People/programs CANNOT read files with the extension .class

    With that said, compress files with the .class extension in a JAR file.

    One more thing, Can I integrate a key functionality so that client can only access that software by first registering it with the key provided by me?
    Second, can I integrate another functionality through which the software can run only on a single machine through that key?
    Not with JAR files.
    Last edited by Lil_Aziz1; 06-08-2010 at 10:08 PM.
    "Experience is what you get when you don't get what you want" (Dan Stanford)
    "Rise and rise again until lambs become lions" (Robin Hood)

  11. #11
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    5

    Default

    Quote Originally Posted by Lil_Aziz1 View Post
    People/programs CANNOT read files with the extension .class

    this is not 100% right. there is a disassembler called javap that allows to diassemble a .class file. if you don't want to let disassemble your code you must use an obfuscator for java bytecode.

  12. #12
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    don't want to let disassemble your code you must use an obfuscator
    You can alway disassemble the code to source. The obfuscator makes the disassembled source very hard to read/understand.

  13. #13
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,856
    Rep Power
    19

    Default

    And considering people have managed to decompile C code, obfuscated Java is only an annoyance.
    Put simply if someone wants to pinch your code then they will.

Similar Threads

  1. Need help for JAVA AI project
    By willemien in forum Jobs Discussion
    Replies: 0
    Last Post: 05-02-2010, 11:52 AM
  2. 3D Java Project
    By ant-mi in forum New To Java
    Replies: 1
    Last Post: 04-19-2010, 01:52 PM
  3. Java Project
    By Smirre in forum New To Java
    Replies: 16
    Last Post: 11-17-2008, 08:37 PM
  4. Packing vars
    By Supamagier in forum Advanced Java
    Replies: 6
    Last Post: 09-20-2008, 12:26 AM
  5. Help with Java project
    By ducster in forum New To Java
    Replies: 11
    Last Post: 12-03-2007, 03:08 AM

Posting Permissions

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