Passing command-line option to JVM
Engineering Specification
RFE: 4523267
Author:Xiaobin Lu
Date: Feb 1, 2002
1.1 Overview
To make some other applications (e.g Internet Browsers) to have the ability
to change JRE settings easily, this RFE provides a command-line utility
to do it.
1.2 Project Dependencies
N/A
1.3 OS and Browser Compatibility and Interoperability
This feature will be available for all supported platforms.
1.4 Performance and Scalability
N/A
1.5 Security
N/A
1.6 Internationalization (I18N) / Localization (L10N)
N/A
1.7 Packaging
N/A
1.8 Usability
This feature enhances the usability of JRE/JPI in terms of tracing and
debugging.
1.9 Quality
1.9.1 Unit or Functional Tests to be Delivered
1.9.2 Additional Testing Notes
It is simple to testing this. Following the "User Interface" section for
requirement of testing across different platforms. Then start up any browser
interested, open Java console to dump out system property "javaplugin.vm.options"
to see whether the option you set is there or not.
2.1 Architecture
The approach using in this RFE is to call Windows API GetEnviromentVariable
or C runtime library getenv to get _JAVA_OPTIONS variable. If this enviroment
variable is set, we ignore whatever the JRE parameters specified by the
user through control panel.
In order to make the debugging process easier, we also dump out all
the vm options to the system properties "javaplugin.vm.options" before
JVM actually get start up.
It is worth to mention that to prevent the user accidentally from setting
up _JAVA_OPTION more than 2048 characters (in Windows platform), we will
take NULL jre parameter to pass to JVM.
2.2 Exported Interfaces/API
N/A
2.3 Imported Interfaces/API
N/A
2.4 User Interface
For Windows NT/2000 users, the user needs to use MSDOS command console
to set _JAVA_OPTIONS.
The following is a snapshot of the command console.
set _JAVA_OPTIONS=-verbose -Djavaplugin.cache.diabled=true
For Windows 9X user, since the DOS command bundled with Windows does
not provide a utility which lets you set a variable containning "=" sign.
So some special techniques need to be used.
The following batch file actually does the work for the user to set
_JAVA_OPTIONS to "-verbose -Djavaplugin.cache.diabled=true". To set the
option you need, you may provide an argument which is your value to _JAVA_OPTION
to the batch file and replace the batch file "-verbose -Djavaplugin.cache.disabled=true"
with "%1".
------Cut and Paste from here------
@ECHO OFF
SET _JAVA_OPTIONS=
SET OP=%PROMPT%
ECHO.PROMPT xx_JAVA_OPTIONS=-verbose
-Djavaplugin.cache.disabled=true>%TEMP%.\P.BAT
ECHO.EXIT|%COMSPEC%/kPROMPT
e108 0$_w$_q|debug %TEMP%.\P.BAT>NUL
FOR %%C IN (CALL DEL)
DO %%C %TEMP%.\P.BAT
SET PROMPT=%OP%
ECHO. Your variable
is: %_JAVA_OPTIONS%
:: Clean up
SET OP=
-----End cut and paste--------------
For Unix users, the user just uses any prefered shell to specify the
enviroment variable. For example if using C shell:
setenv _JAVA_OPTIONS "-verbose -Djavaplugin.cache.disabled=true".
3.1 Justification
This RFE was originated from SAS who has an IDE for debugging applets inside
the browser. The issue is that they can't debug applets through JPI out
of the box because we don't run the JRE in debug mode by default. As a
result, they need a way to change the runtime parameter settings for JPI
on-the-fly. However, there are several problems:
- When they launch the browser
through IDE, they can't determine which version of JPI will be launched
in the browser eventually.
- The filename of the JPI property
file for Control Panel is not well documented.
- They want to affect the JRE
settings only for a particular browser session, but not all of them.
- They want to have the ability
to change JRE settings easily.
So having an easier way to change JRE settings is necessary.
3.2 Customer Request
3.3 Competitive Analysis
Using command-line option to pass JVM start up option seems to be the best
way to resolve this.
4 Management and Planning
|
4.1 Scope/Priority
P3
4.2 Target Release
Hopper
4.3 Resources
4.3.1 Development
4.3.2 Quality Assurance/Testing
4.3.3 Documentation
4.3.4 Technical Support
4.3.4 Special Hardware/Software
4.4 Schedule
Start Date |
End Date |
Activity |
Owner |
Status |
1/10/2002 |
2/10/2002 |
|
Xiaobin Lu |
|
|
|
|
|
|
|
|
Complete |
Started |
Not Started |
Difficulties |
Trouble |
Appendices (as needed, suggestions below)
|
A. Background Information
B. Interface Specifications
C. Notes and Additional Details
The enviroment variable setting will replace the JRE parameters specified
in the control panel. The java interpreter program "java" also recognize
this option.
D. Miscellaneous
E. Tracking
E.1 Final Webrev
E.2 Bugtraq
Bugid |
P |
S |
Subcategory |
Type |
Engineer |
Synopsis |
|
|
|
|
|
|
|
|
Date |
Version |
Author |
Description |
|
|
|
|
|