Results 1 to 11 of 11
  1. #1
    Rajiv1 is offline Member
    Join Date
    Aug 2011
    Posts
    5
    Rep Power
    0

    Exclamation How to deploy CoreJava standalone desktop application?

    Hi Guys,

    I've built an application using corejava (no GUIs) which is like a tracker of your mobile bill.
    This project runs as expected without any error.

    Now all I want is to deploy this project in my desktop ( no need to install it like any other software, just need to run it) & need to run this as an exe.

    Please let me know how do I do this?

    Iam not an experianced programmer. please let me know. I am using Eclipse IDE & Java SE6 Win7 environment.

    Thanks,
    Rajeev

  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    You will want to create a jar file, I'm not sure how to do this with eclipse, but I'm sure there is an eclipse tutorial that you can find with google. Try "create jar with eclipse"

  3. #3
    Rajiv1 is offline Member
    Join Date
    Aug 2011
    Posts
    5
    Rep Power
    0

    Post Done. But need more., it should start running when I open this.

    Thanks. But I have generated jar file already & I made it to open with cmd. When I double click on this jar to open it it opens & the path command prompt displays. Now I have to enter this command
    "java -jar Bill.jar" to run my application.

    What I want is when I open the jar file(Bill.jar) it should not expect me to run the above command. Instead it should start running the application.

    So please suggest on that.

    Thanks,
    Rajiv

  4. #4
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    You need to write a manifest file that tells the JVM which class contains the main method you want to run. Then build the jar and include this manifest file and you should be able to click the jar to begin running it.

  5. #5
    Rajiv1 is offline Member
    Join Date
    Aug 2011
    Posts
    5
    Rep Power
    0

    Post Again same problem!!

    I have created jar file manually by including manifest file & the jar creation was successful but it stays at the location where this jar file is located & does not run automatically. What can be the problem?

    I have included this in my manifest file,

    Main-Class: MobileBill

    I named it as Man.mf & jar creation is absolutely successful. But it does not run when you double click on it.

    I have copy pasted from cmd when I ran these,

    D:\Java-WorkSpace\MobileBill>jar -cfmv Tester.jar Man.mf com/*.class com/utility
    /*.class
    added manifest
    adding: com/MobileBill.class(in = 2194) (out= 1261)(deflated 42%)
    adding: com/utility/Checker.class(in = 3522) (out= 1963)(deflated 44%)
    adding: com/utility/Read.class(in = 2761) (out= 1268)(deflated 54%)
    adding: com/utility/Utility.class(in = 5951) (out= 3140)(deflated 47%)

    D:\Java-WorkSpace\MobileBill>

    =======================

    Here is what it displays when I click on Tester.jar , (displayed in cmd)

    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    D:\Java-WorkSpace\MobileBill>
    ==================

    Now at the above prompt I have to type java -jar Tester.jar to run this application. It works well.
    What I want is when I open Tester.jar instead of displaying & stopping like above it should automatically start executing the application.

    Please let me know if any errors above & how to make it run automatically.
    Last edited by Rajiv1; 08-11-2011 at 10:00 AM.

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

    Default

    If you right click on the jar file and select properties what does Windows say it should use to open the jar file?
    It should be the JRE installed on your system.

  7. #7
    Rajiv1 is offline Member
    Join Date
    Aug 2011
    Posts
    5
    Rep Power
    0

    Post

    Yes when I first created the jar file it was Java Platform SE Binary (I have installed JRE 6) which was the default option to open the jar file with. But it did not display anything. So I changed it to cmd prompt. Please note that I have not written any GUI for this application. Its pure core java application using S.o.p().

    Thanks,
    Rajeev

  8. #8
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,784
    Rep Power
    7

    Default

    Well you could move into the 21st century and write a GUI. Or you can write a bat file to run your program.
    Java Code:
    java -jar YourJarFileName.jar
    pause
    Save that in SomeFileName.bat. Then you double click the bat file.

  9. #9
    Hibernate's Avatar
    Hibernate is offline Senior Member
    Join Date
    Dec 2010
    Location
    Stockholm, Sweden
    Posts
    222
    Blog Entries
    9
    Rep Power
    4

    Default

    Quote Originally Posted by Junky View Post
    Well you could move into the 21st century and write a GUI.
    GUI:s are obsolescent. The new world will be, once again, headless graphical terminal user interfaces.
    Ex animo! Hibernate
    Java, Arch Linux, C, GPL v3, Bash, Eclipse, Linux VT, GNOME 2 and many buttons on windows.

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

    Default

    Quote Originally Posted by Rajiv1 View Post
    Yes when I first created the jar file it was Java Platform SE Binary (I have installed JRE 6) which was the default option to open the jar file with. But it did not display anything. So I changed it to cmd prompt. Please note that I have not written any GUI for this application. Its pure core java application using S.o.p().

    Thanks,
    Rajeev
    Except cmd can't open it.
    You need to tell cmd what to do, which would be something like (and I really can't tell you the exact syntax):
    cmd /c "java -jar" "%1"

  11. #11
    Rajiv1 is offline Member
    Join Date
    Aug 2011
    Posts
    5
    Rep Power
    0

    Thumbs up Done

    Thanks .bat file worked well. Thank you all for your replies. I will now start converting it to web application. Thank you so much for your time.

Similar Threads

  1. Is it possible to deploy a JSF application on cloud???
    By K.Satish in forum JavaServer Faces (JSF)
    Replies: 1
    Last Post: 01-09-2012, 04:14 AM
  2. How to create datasource for standalone application using JPA
    By identita in forum Enterprise JavaBeans (EJB)
    Replies: 0
    Last Post: 12-03-2009, 01:04 AM
  3. How to Deploy Java Application?
    By pootietang in forum New To Java
    Replies: 6
    Last Post: 02-22-2009, 09:25 PM
  4. howto make a standalone application?
    By Jerre in forum New To Java
    Replies: 4
    Last Post: 06-08-2008, 09:58 AM
  5. deploy a web application
    By Peter in forum Advanced Java
    Replies: 2
    Last Post: 07-04-2007, 01:45 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
  •