Solved

OS Independent CD

Posted on 2001-06-20
14
184 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
Comment Utility
yes, you must put your project, JVM, and like an autorun file on the CD.
0
 
LVL 1

Author Comment

by:wgilster
Comment Utility
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
Comment Utility
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
 
LVL 1

Author Comment

by:wgilster
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 4

Accepted Solution

by:
Neutron earned 50 total points
Comment Utility
Autorun is Windows-specific.

Greetings,
    Ntr:)
0
 
LVL 1

Author Comment

by:wgilster
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now