Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within I/O and Streams
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Liutauras Vilda
Ron McLeod
Sheriffs:
Jeanne Boyarsky
Devaka Cooray
Paul Clapham
Saloon Keepers:
Scott Selikoff
Tim Holloway
Piet Souris
Mikalai Zaikin
Frits Walraven
Bartenders:
Stephan van Hulst
Carey Brown
Forum:
I/O and Streams
something wrong with null exception in I/O processing
John Batista
Greenhorn
Posts: 20
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I have a code that should've worked, but didn't
What's the problem? thanks
Stephan van Hulst
Bartender
Posts: 15737
368
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
c is null. System.console() doesn't return a console in your case.
John, next time please post actual code, instead of screenshots. It makes it easier for us to help you, and it reduces bandwidth needed.
John Batista
Greenhorn
Posts: 20
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
OK, so how do I make the console not null? thanks
Stephan van Hulst
Bartender
Posts: 15737
368
posted 13 years ago
1
Number of slices to send:
Optional 'thank-you' note:
Send
By running your program from the command line, instead of from Eclipse.
Rob Spoor
Sheriff
Posts: 22818
132
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Stephan is right. System.console() only returns a non-null value if it's actually run from the console.
IDE
's like Eclipse try to emulate a console but this is not the same, and therefore System.console() returns null.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions
How To Answer Questions
That's my roommate. He's kinda weird, but he always pays his half of the rent. And he gave me this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Favorite Movie
WHY WOMEN LIKES TO SHOW THEIR FLASH UNLIKE MEN.
applets
suite method
Hi
More...