Solved

OS Independent CD

Posted on 2001-06-20
14
190 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

809 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