Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5027269

(process) System.getenv() throws ExceptionInInitializerError in Netscape 4.x

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_8

      Description

      Name: atR10251 Date: 04/06/2004


      The problem comes up when System.getenv() is called from an applet inside Netscape 4.x on Solaris.

      Run this applet to reproduce it:

      -----------------------------------
      import java.applet.Applet;

      public class MyApp extends Applet {
          public void start() {
              System.getenv("DISPLAY");
          }
      }
      -----------------------------------

      The following exception will be thrown:

      java.lang.ExceptionInInitializerError
              at java.lang.System.getenv(System.java:795)
              at MyApp.start(MyApp.java:5)
              at sun.applet.AppletPanel.run(AppletPanel.java:394)
              at java.lang.Thread.run(Thread.java:570)
      Caused by: java.lang.NullPointerException
              at java.lang.String.<init>(String.java:486)
              at java.lang.ProcessEnvironment$Variable.valueOf(ProcessEnvironment.java:157)
              at java.lang.ProcessEnvironment.<clinit>(ProcessEnvironment.java:58)
              ... 4 more

      Despite the fact that this method is deprecated we use it in AWT code because of the absence
      of any alternative. You may look at the bug 4979996 to see this necessity.
      Regarding this problem, we found a workaround so that we avoid calling System.getenv() in applets,
      but still need it in applications.

      So, I file this bug just to show the problem.
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                martin Martin Buchholz
                Reporter:
                ant Anton Tarasov
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: