Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

NullPointerException at getenv

800474Jul 31 2006 — edited Jul 31 2006
Hi, I'm getting the following NPE when calling System.getenv:
java.lang.NullPointerException
        at java.lang.ProcessEnvironment$Variable.valueOfQueryOnly(Unknown Source)
        at java.lang.ProcessEnvironment$Variable.valueOfQueryOnly(Unknown Source)
        at java.lang.ProcessEnvironment$StringEnvironment.get(Unknown Source)
        at java.lang.ProcessEnvironment$StringEnvironment.get(Unknown Source)
        at java.util.Collections$UnmodifiableMap.get(Unknown Source)
        at java.lang.ProcessEnvironment.getenv(Unknown Source)
        at java.lang.System.getenv(Unknown Source)
It's strange because all goes well when running it from Eclipse, but it fails when calling java from the command line.

The exception above is raised within a Java Swing application.

Thank you for any help!
God bless
Jaime
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 28 2006
Added on Jul 31 2006
2 comments
435 views