Results 1 to 11 of 11
- 08-08-2011, 06:44 PM #1
Member
- Join Date
- Aug 2011
- Posts
- 5
- Rep Power
- 0
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
- 08-08-2011, 06:59 PM #2
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,068
- Blog Entries
- 3
- Rep Power
- 13
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"
- 08-09-2011, 09:25 AM #3
Member
- Join Date
- Aug 2011
- Posts
- 5
- Rep Power
- 0
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
- 08-09-2011, 09:28 AM #4
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,068
- Blog Entries
- 3
- Rep Power
- 13
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.
- 08-11-2011, 10:58 AM #5
Member
- Join Date
- Aug 2011
- Posts
- 5
- Rep Power
- 0
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 11:00 AM.
- 08-11-2011, 04:02 PM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 13,541
- Rep Power
- 26
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.
- 08-12-2011, 05:42 AM #7
Member
- Join Date
- Aug 2011
- Posts
- 5
- Rep Power
- 0
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
- 08-12-2011, 05:57 AM #8
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
- 08-12-2011, 06:23 AM #9
- Join Date
- Dec 2010
- Location
- Stockholm, Sweden
- Posts
- 222
- Blog Entries
- 9
- Rep Power
- 9
- 08-12-2011, 10:28 AM #10
Moderator
- Join Date
- Apr 2009
- Posts
- 13,541
- Rep Power
- 26
- 08-12-2011, 08:33 PM #11
Member
- Join Date
- Aug 2011
- Posts
- 5
- Rep Power
- 0
Similar Threads
-
Is it possible to deploy a JSF application on cloud???
By K.Satish in forum JavaServer Faces (JSF)Replies: 1Last Post: 01-09-2012, 05:14 AM -
How to create datasource for standalone application using JPA
By identita in forum Enterprise JavaBeans (EJB)Replies: 0Last Post: 12-03-2009, 02:04 AM -
How to Deploy Java Application?
By pootietang in forum New To JavaReplies: 6Last Post: 02-22-2009, 10:25 PM -
howto make a standalone application?
By Jerre in forum New To JavaReplies: 4Last Post: 06-08-2008, 10:58 AM -
deploy a web application
By Peter in forum Advanced JavaReplies: 2Last Post: 07-04-2007, 02:45 PM
Bookmarks