Java & OS Platforms
This web page has examples of using Java in various OS Platforms.
Examples
- Java System Properties - contains an
Applet/Application that shows System Properties. If you run it as a
application you can see additional System Properties.
- SystemProperties.zip - Download the
HTML & 2 class files needed so you can run this applet on your local
PC. You may have a firewall that is stopping applets from running.
Additional Notes
- Runtime.exec() - execute a local program (make native system
calls).
- Example of calling a batch file from Java.
String strCmd = "play.bat";
Process p = Runtime.getRuntime().exec(strCmd);
- For Windows platforms (95,98, Win NT), this is an example of calling
rundll32.exe and allowing it to load the resource associated with the
file extension. This code will launch the default browser
for HTML files and then view the html file "play.htm".
String strCommand = "play.htm";
String strCmd = "rundll32 url.dll,FileProtocolHandler" + " " +
strCommand;
Process p = Runtime.getRuntime().exec(strCmd);
- Mac/Apple notes: