File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Java on CD-ROM Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java on CD-ROM" Watch "Java on CD-ROM" New topic

Java on CD-ROM

Vinnie Jenks
Ranch Hand

Joined: Apr 26, 2004
Posts: 207
My company is creating a CD-ROM they'll be sending out to all of their customers. On it they would like to include a simple calculator for their products that has a simple database back-end (read-only).

How can I package a Java app, say, using Swing, on a CD-ROM to where the users would not have to install the JRE (it would be on the CD)?

In other words, how can I make a jar or another type of executable that can be clicked-and-run directly from the would I make a call to the local JRE on the CD?

Jeff Bosch
Ranch Hand

Joined: Jul 30, 2003
Posts: 805
I would create a batch file to run from the local JRE. If the batch file is on the root directory of the CD, the java.exe is in a jre/bin folder, and the app is in an app/ folder, and it's in a jar called app.jar, you could do something like the following in the bat file:

/jre/bin/java.exe -jar app/app.jar

Hope that helps.

Give a man a fish, he'll eat for one day. Teach a man to fish, he'll drink all your beer.
Cheers, Jeff (SCJP 1.4, SCJD in progress, if you can call that progress...)
I agree. Here's the link:
subject: Java on CD-ROM
It's not a secret anymore!