Solved

OS Independent CD

Posted on 2001-06-20
14
186 Views
Last Modified: 2010-04-16
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.  
0
Comment
Question by:wgilster
  • 4
  • 3
  • 2
  • +3
14 Comments
 
LVL 9

Expert Comment

by:Ovi
ID: 6210537
yes, you must put your project, JVM, and like an autorun file on the CD.
0
 
LVL 1

Author Comment

by:wgilster
ID: 6210561
That sounds like a plan, but how will the autorun file know which JVM to use on the CD?
0
 
LVL 9

Expert Comment

by:Ovi
ID: 6211178
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.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 1

Author Comment

by:wgilster
ID: 6211194
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?
0
 

Expert Comment

by:smileyxx
ID: 6211609
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.
0
 
LVL 1

Author Comment

by:wgilster
ID: 6211754
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.
0
 
LVL 4

Accepted Solution

by:
Neutron earned 50 total points
ID: 6212038
Autorun is Windows-specific.

Greetings,
    Ntr:)
0
 
LVL 1

Author Comment

by:wgilster
ID: 6212049
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?
0
 
LVL 4

Expert Comment

by:Neutron
ID: 6212210
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:)
0
 

Expert Comment

by:smileyxx
ID: 6212372
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.
0
 

Expert Comment

by:smileyxx
ID: 6212413
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

0
 

Expert Comment

by:CleanupPing
ID: 9062028
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.
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 9253875
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.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
eclipse argument 14 61
Way to decrease size of apk file 9 69
hibernate example using maven 12 42
Android development question 2 37
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question