Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-14-2009, 04:50 PM
aaroncarpet's Avatar
Senior Member
 
Join Date: Nov 2009
Location: California
Posts: 138
Rep Power: 0
aaroncarpet is on a distinguished road
Send a message via Yahoo to aaroncarpet
Default is there a way to tell how to execute a java program in the jar
Myself am a java user so I know after I have jarred my application i can use the command prompt to do something like
this: java -Xms10m -Xmx1024m -jar aaron1.jar

but if I give my average computer user my jarred program they won't be able to do that, they will just double click it and it will automatically use javaw.exe

because i have certain things that I want to come on the command shell it is insufficient, plus, if they close my program that they double clicked, there will still be a javaw.exe process running in their task manager (the process that was supposed to be in the command shell) it will bog there cpu and they won't know why there is a problem and if they don't know how to go unto the tskmmanager and end their javaw.exe process they won't be able to stop it until they restart their computer.

Last edited by aaroncarpet; 11-14-2009 at 04:51 PM. Reason: typos
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 11-14-2009, 04:59 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,256
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
If you want to execute your application on command prompt, then use a bat file for the execution.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 11-14-2009, 06:05 PM
aaroncarpet's Avatar
Senior Member
 
Join Date: Nov 2009
Location: California
Posts: 138
Rep Power: 0
aaroncarpet is on a distinguished road
Send a message via Yahoo to aaroncarpet
Default Batch files
I will have to do my research but from what I hear you are saying i can use a dos batch file to execute the command line but the user won't be able to click the bat file(will they?). I have been searching manifest stuff up and down and it doesn't look possible to do it that way.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 11-14-2009, 06:23 PM
aaroncarpet's Avatar
Senior Member
 
Join Date: Nov 2009
Location: California
Posts: 138
Rep Power: 0
aaroncarpet is on a distinguished road
Send a message via Yahoo to aaroncarpet
Default does vista have an autoexec.bat
i am going through a tutorial but i think i don't need to modify autoexec.bat
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 11-14-2009, 11:46 PM
aaroncarpet's Avatar
Senior Member
 
Join Date: Nov 2009
Location: California
Posts: 138
Rep Power: 0
aaroncarpet is on a distinguished road
Send a message via Yahoo to aaroncarpet
Default
Eranga is right the batch file can control the command path so the end user doesn't have to think...a smart lady she is

I am using Vista and there is no autoexec.bat and YES you Can double click a batch file and it will execute

Last edited by aaroncarpet; 11-14-2009 at 11:48 PM. Reason: forgot something
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 11-15-2009, 03:15 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,256
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Originally Posted by aaroncarpet View Post
I will have to do my research but from what I hear you are saying i can use a dos batch file to execute the command line but the user won't be able to click the bat file(will they?). I have been searching manifest stuff up and down and it doesn't look possible to do it that way.
Use of bat files is not a bad idea. Most of the standalone application use bat files a lot. So in my experience, I'm not worried to use them in my applications. Lot's of people get use of nowadays.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 11-15-2009, 03:18 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,256
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Originally Posted by aaroncarpet View Post
i am going through a tutorial but i think i don't need to modify autoexec.bat

That's the power of bat files. You can edit AUTOEXEC.bat file, which is heavily use by the OS, through your bat files. But you have to really care about that. You are going to do changes on client machines, and different users have different settings on there bat files. So if something is going wrong they will blame on you.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 11-15-2009, 03:23 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,256
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Originally Posted by aaroncarpet View Post
Eranga is right the batch file can control the command path so the end user doesn't have to think...a smart lady she is

I am using Vista and there is no autoexec.bat and YES you Can double click a batch file and it will execute
In Vista they are no longer use AUTOEXEC.bat, all the settings passes to the environment variables. May be there is a single dummy entries/settings in the initial installation.

That means you can see a AUTOEXEC.bat file in vista, but write protected. And also it's hidden as in previous Windows OSs. Again it's NOT a good idea to change system protected files.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 11-16-2009, 05:33 AM
aaroncarpet's Avatar
Senior Member
 
Join Date: Nov 2009
Location: California
Posts: 138
Rep Power: 0
aaroncarpet is on a distinguished road
Send a message via Yahoo to aaroncarpet
Default dummy bat
yeah I got the dummy bat in vista which means that i can create an executeable bat without touching the os....pretty much the bat does the command line...but Eranga? I have j2se installed...what about clients with just the jre do they have java and javaw?

the original tutorial was for dos based and they wanted the user to modify the autoexec.bat to include the directory of their bat
so now the question is ....I specified my folder allocation in my bat so how do i control folder allocation when deploying on a client computer

Last edited by aaroncarpet; 11-16-2009 at 05:38 AM. Reason: explanation
Bookmark Post in Technorati
Reply With Quote
  #10 (permalink)  
Old 11-19-2009, 05:31 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,256
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Originally Posted by aaroncarpet View Post
I have j2se installed...what about clients with just the jre do they have java and javaw?
To run your Java application (I hope it's desktop application) JRE is enough.

Originally Posted by aaroncarpet View Post
the original tutorial was for dos based and they wanted the user to modify the autoexec.bat to include the directory of their bat
so now the question is ....I specified my folder allocation in my bat so how do i control folder allocation when deploying on a client computer
I'm not clear exactly what's you are looking for? Do you want to create folder structure within your application and place bat file there?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Tags
jar, javavsjavaw

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Execute external program from java ankitmcgill New To Java 1 06-01-2009 04:58 AM
Execute a jar command from a java program apremanandh New To Java 3 05-21-2008 03:04 PM
How to execute an External Program through Java program Java Tip java.io 0 04-04-2008 03:40 PM
How to execute an External Program through Java program JavaBean Java Tips 0 10-04-2007 10:33 PM
Execute a new program in java mathias Advanced Java 1 07-31-2007 06:42 AM


All times are GMT +2. The time now is 12:26 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org