• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How do I deploy my application using a jar?

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have seen questions and (limited)examples on various places on the web but I am yet to see an example that shows how to create a manifest file that includes a main class file and a number of others(including inner classes),gif or jpeg images
and or sounds. i would love to create an application that only requires double clicking an icon to start it. please give me a detailed example of creating jar files.
thanx
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://java.sun.com/docs/books/tutorial/jar/basics/run.html
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Of you can use a .bat/.sh file with the instructions on invoking your application. This can then be hooked to an icon for starting with a click.
 
TJ Hylton
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cindy how do i create a .bat/sh file? and how do i use the icon? details please.
 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For the bat file open up notepad and save as "***.bat", that is a bat file. Now here is what I put in mine:
cd c:\
c:\jdk1.3.1_02\bin\java dmsi.campaignbuilder.CampaignBuilder
Note: I have not set my classpath and I am running a application in a jar file.
To see how I was able to jar this application, there is a thread under the beginners forum from about 1-2 days ago. Hope this helps.
Dean
 
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
.bat and .sh files are scripting files for windows and linux/unix (respectively). they are just text files that contain a list of commands to be run. try this:
open up notepad, type in "echo hello world!" then save as "hello.bat". go to command prompt (start, run, type in "command" if you are on win9x, or "cmd" if you are on win2k) then change to the directory where the hello.bat file is. type in "hello.bat" and press enter. it will print out "hello world".
for more info, do a search for "batch file tutorial" on your favorite search engine.
 
Cindy Glass
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For a simple case where there is no jar file no other jar files to consider (and the jdk is in c:\dir\jre\bin - but you can change that) you have 3 commands. 1 Get to the correct directory. 2 - Set the path. 3 Call java (or javaw) with a classpath parameter (most likely) and name the class to execute.
In file Appl.bat you put:
cd \dir
path = .;C:\dir;C:\dir\jre\bin;
"c:\dir\jre\bin\javaw" -classpath .;"c:\dir" Appl

For a complicated example that has the runtime stuff embedded in the HUGE classpath statement, and is expecting a properties file in- something like this (still 3 commands):
cd \dir
path = .;C:\dir;C:\dir\jre\bin;
"c:\dir\jre\bin\javaw" -classpath .;"c:\dir";"c:\dir\Appl.jar";"c:\dir\deploy.jar";"c:\dir\jre\lib\rt.jar";"c:\dir\jre\lib\jaws.jar";"c:\dir\jre\lib\i18n.jar";"c:\dir\classes12.jar";"c:\dir\images" Appl.someSubDirectory.Appl "c:\dir\APPl.properties"
 
Don't listen to Steve. Just read this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic