Results 1 to 19 of 19

Thread: Java software

  1. #1
    tyang is offline Member
    Join Date
    Jan 2010
    Posts
    44
    Rep Power
    0

    Default Java software

    I have implemented a software by Java. I want to make the software user friendly and as simple as possible.

    Can I make my Java code into an application that the users do not have to install Java in their computer?

  2. #2
    iluxa is offline Senior Member
    Join Date
    Mar 2010
    Posts
    266
    Rep Power
    5

    Default

    bad news - no, you cannot. good news - everybody already has Java anyway.

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,776
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by iluxa View Post
    bad news - no, you cannot. good news - everybody already has Java anyway.
    Has *what*?

    kind regards,

    Jos ;-)

  4. #4
    Drun's Avatar
    Drun is offline Member
    Join Date
    Nov 2009
    Location
    Indian Head, MD (Missing Pittsburgh PA)
    Posts
    44
    Rep Power
    0

    Default

    Every one already has the JRE installed (well not every body, but 95%+ of the people, and the 5% that don't eather have computers so old that it can not run it, or removed it for reasons of their own, but the poeple you are focusing I would say 99.999% of them probably do have the JRE installed)

    So all they will need to run your program is the class files or the jar file (if you put all your code in a jar file, and I recomend you do)

    All you really need to do is put all in a jar file.
    Michael P. O'Connor
    http://www.mikeoconnor.net

  5. #5
    tyang is offline Member
    Join Date
    Jan 2010
    Posts
    44
    Rep Power
    0

    Default

    Many thanks to all of you! Special thanks to Drun!

    My software imports a jar file for an external package.

    How can I make my java code as a jar file with such a "imported" jar file?

    Many thanks in advance!

  6. #6
    Drun's Avatar
    Drun is offline Member
    Join Date
    Nov 2009
    Location
    Indian Head, MD (Missing Pittsburgh PA)
    Posts
    44
    Rep Power
    0

    Default

    There are 2 ways I can think of. 1) include the jar file with your jar file and make sure you set up the class path when your program is ran. 2) (not 100% sure how to do this but I seen it done) unpack the other jar file, and pack the class files from inside of that jar file (a jar file is nothing more then a zip file with a few special directories and files inside of it) into your jar file.
    Michael P. O'Connor
    http://www.mikeoconnor.net

  7. #7
    gcalvin is offline Senior Member
    Join Date
    Mar 2010
    Posts
    952
    Rep Power
    5

    Default

    It is possible to write code in Java and deploy it to machines that don't have a JRE installed -- but it's a particular subset of Java compiled into JavaScript by Google Web Toolkit and deployed to web browsers.

    Google Web Toolkit - Google Code

    I do not mean to suggest that this is a viable replacement for real Java. But depending on what it is, how it's designed, and how much Java it uses, it may be a possibility.

    -Gary-

  8. #8
    tyang is offline Member
    Join Date
    Jan 2010
    Posts
    44
    Rep Power
    0

    Default

    I think my question is a common concern for software developers. I want the users to make a simple click and then he/she can start the journey of using my soft.

    If I make a jar file then the user need either:
    1) Go to DOS and specify the class path
    2) Go to eclipse and create the project.

    I think 2) is easier but not everyone has Eclipse.

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

    Default

    Quote Originally Posted by tyang View Post
    I think my question is a common concern for software developers. I want the users to make a simple click and then he/she can start the journey of using my soft.

    If I make a jar file then the user need either:
    1) Go to DOS and specify the class path
    2) Go to eclipse and create the project.

    I think 2) is easier but not everyone has Eclipse.
    I think you're over-complicating things. If you make a decent Jar file, as long as the user has the Java run time, the user can just use it.

  10. #10
    gcalvin is offline Senior Member
    Join Date
    Mar 2010
    Posts
    952
    Rep Power
    5

    Default

    As a practical matter, it's very unusual today for a piece of software not to have some sort of runtime requirement. More and more Windows software is based on the .NET runtime, and for many years before that there were Visual Basic runtimes and MFC dependencies and library dependencies people spoke of as ".DLL hell". And other platforms have their dependencies as well.

    -Gary-

  11. #11
    tyang is offline Member
    Join Date
    Jan 2010
    Posts
    44
    Rep Power
    0

    Default

    Thanks for your advises!

    Can anyone tells me which option is better for the users to run the Java Software?
    1. Use DOS Command to run the Jar file (I think users have to specify the class path)
    2. Use Eclipse to run the Jar file

  12. #12
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    1.) Works only on computers that have DOS.
    2.) Eclipse is a development kit used by developers. Why would users need to install Eclipse to be able to run your program if they already have the JRE?

    Better get Oracle's tutorial on jar files and deployment and read it.

  13. #13
    tyang is offline Member
    Join Date
    Jan 2010
    Posts
    44
    Rep Power
    0

    Default

    Users can use DOS to run the .jar file. But it is complicated for them to specify the class path, isn't it?

  14. #14
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    You would have to create the .bat file for them.
    Much better is to read the tutorial I suggested so that you can create an executable jar than can be used on different platforms as long as they have the JRE.

  15. #15
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    If you've built your jar file correctly (ie with the correct Manifest in it) the user should simply be able to double click on the jar and run it. If you have dependencies on thrid party jars then you package them with your jar. Netbeans creates a directoty structure something like:
    Java Code:
    dist -> MyJar.jar
            lib -> other libs
    and the Manifest refers to the jars in the lib directory.

  16. #16
    tyang is offline Member
    Join Date
    Jan 2010
    Posts
    44
    Rep Power
    0

    Default

    Can anyone tell me how to make the jar file and how to specify the class path when the users just want to use it?

    Your help will be very much appreciated!

  17. #17
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

  18. #18
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    Between that and my little diagram of a distribution structure you should be able to write this yourself.

  19. #19
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,776
    Blog Entries
    7
    Rep Power
    21

    Default

    A bit of an example; here's a manifest file I use:

    Java Code:
    Manifest-Version: 1.0
    Created-By: my company
    Main-Class: MyMainClass
    Class-Path: relative/path/to/other/files.jar
    Built-By: my company
    Name: Name Of This Application
    Specification-Title: Title Of This Application
    Specification-Version: 1.0
    Specification-Vendor: my company
    Implementation-Title: Title Of This Application
    Implementation-Version: 1.0
    Implementation-Vendor: my company
    Add this as your manifest in your .jar file (after supplying the necessary information) and you can simply double click on the .jar to run it.

    kind regards,

    Jos

Similar Threads

  1. Replies: 0
    Last Post: 01-15-2010, 08:16 AM
  2. Software Engineers - Java
    By pooja_k in forum Jobs Offered
    Replies: 0
    Last Post: 01-06-2010, 10:19 AM
  3. Senior Java Software Developer
    By Java the Hut in forum Jobs Offered
    Replies: 2
    Last Post: 08-22-2009, 07:21 PM
  4. Java Web software architect
    By RonCourtech in forum Jobs Offered
    Replies: 0
    Last Post: 09-22-2008, 05:21 PM
  5. java software for OMR
    By priyarenjith in forum New To Java
    Replies: 0
    Last Post: 07-02-2008, 09:55 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
  •