This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 233897 - global variable doesn't work in the main class
Summary: global variable doesn't work in the main class
Status: RESOLVED INVALID
Alias: None
Product: editor
Classification: Unclassified
Component: Hints & Annotations (show other bugs)
Version: 7.3.1
Hardware: PC Windows 8
: P1 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-03 19:15 UTC by newtonE
Modified: 2013-08-04 06:29 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (41.40 KB, text/plain)
2013-08-03 19:15 UTC, newtonE
Details

Note You need to log in before you can comment on or make changes to this bug.
Description newtonE 2013-08-03 19:15:31 UTC
Product Version = NetBeans IDE 7.3.1 (Build 201306052037)
Operating System = Windows 8 version 6.2 running on amd64
Java; VM; Vendor = 1.7.0_25
Runtime = Java HotSpot(TM) 64-Bit Server VM 23.25-b01

Whenever i try using a global variable in a class, an error occurs stating (error: non-static variable cannot be referenced from a static context)

please help how can i get around this
Comment 1 newtonE 2013-08-03 19:15:39 UTC
Created attachment 138234 [details]
IDE log
Comment 2 Marian Mirilovic 2013-08-04 06:29:59 UTC
Just follow the hint and do not reference non-static global variable from static context.