• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I deploy my application using a jar?

 
TJ Hylton
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Keivin Xu
Greenhorn
Posts: 4
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cindy how do i create a .bat/sh file? and how do i use the icon? details please.
 
Dean Reedy
Ranch Hand
Posts: 89
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Jon Dornback
Ranch Hand
Posts: 137
  • 0
  • Mark post as helpful
  • send pies
  • 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"
Sheriff
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • 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"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic