Link to home
Start Free TrialLog in
Avatar of wgilster
wgilster

asked on

OS Independent CD

I know it's possible to start a java program on inserting a cd, but I want to assume there is no JVM installed on the OS.  On inserting the CD you have to use the appropriete JVM supplied on the CD.  
Avatar of Ovi
Ovi

yes, you must put your project, JVM, and like an autorun file on the CD.
Avatar of wgilster

ASKER

That sounds like a plan, but how will the autorun file know which JVM to use on the CD?
The autorun must know only about one file called run.bat which must do the start of the java program, by using the JVM stored on the CD. This run.bat must set itself the paths to the JRE, the classpath, and so on.
That still doesn't answer my question.  If I have multiple JVM's on the CD how will the run.bat know which JVM to use for the specific platform that I'm on?
You need to have a different run.bat for each platform.
E.g. for windows you might have run-windows.bat, unix might have run-unix.sh and so on. On Mac you'll have to build a little program launcher with the MRJ. Each platform does things differently so it's impossible to have a single launcher for each. You can't have a single script that detects which OS is running. After all, detecting the OS is OS dependent! For instance on UNIX, you could use the uname command in a shell script, but that won't work on Windows and certainly not on the Mac.
I follow what your saying exactly smileyxx, but I need a little more detail.  I know that Windows has an "Autorun.ini" file that controls what program to launch when a cd is inserted, but I don't know how other operating systems handle the "cd insert" event.  Or maybe you could point me in the direction of where I could find out more information about this.
ASKER CERTIFIED SOLUTION
Avatar of Neutron
Neutron

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I didn't realize that Autorun was Windows-specific.  I thought the Mac had some type of autorun capibility?  What about when you click on the cd-rom drive on a Mac, doesn't execute a program, or do you have to tell it which program to start?
Yes, ISO9660 discs with Autorun.INF are for windows only.

However, you can write an "hybrid" disc with sections for Mac and Windows separately. For Mac, Acapdec TOAST supports this and there is a possibility to run selected
program on Mac portion of the disc.

Take look at this link.
http://www.union.edu/RESOURCES/curriculum/tips/hybrid/

For RedHat Linux there's  the  'magicdev' which supports
autorun scripts, but that's RedHat specific and it is optional, so you cannot count on that.
Presumably, there are more 3rd party autorunners for Linux.

For this magicdev, take a look at
http://www.ccs.neu.edu/home/bchafy/magicdev.html
which describes it and there you have an example of the script, taken from RedHat distribution.

So, all these things are specific for the platform (especially for Mac) and there is no standard way to cover all Java target platforms.

Greetings,
    Ntr:)


Greetings,
    Ntr:)
As Neutron says, autorun.inf is windows-specific.
And have you noticed that it doesn't always work?
Mac and most UNIX do not have autorun capabilities, but what typically happens is that the disc is automounted and an icon for it appears on the desktop (Solaris will bring up a file manager window).

The best you can do is clearly indicate which program to run for each particular platform.
I partially take that back: if installed, QuickTime 2.0 does add autostart capabilities to Mac OS.

See here:

http://developer.apple.com/qa/qtpc/qtpc12.html

wgilster:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:


[points to Neutron]


Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
sudhakar_koundinya
EE Cleanup Volunteer
---------------------
If you feel that your question was not properly addressed, or that none of the comments received were appropriate answers, please post your concern in THIS thread.