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.
The following runs fine from the CLI: thufir@dur:~$ thufir@dur:~$ java -jar NetBeansProjects/WeatherTelnet/dist/WeatherTelnet.jar ----------------------------------------------------------------------------- * Welcome to THE WEATHER UNDERGROUND telnet service! * ------------------------------------------------------------------------------ * * * National Weather Service information provided by Alden Electronics, Inc. * * and updated each minute as reports come in over our data feed. * * * * **Note: If you cannot get past this opening screen, you must use a * * different version of the "telnet" program--some of the ones for IBM * * compatible PC's have a bug that prevents proper connection. * * * * comments: jmasters@wunderground.com * ------------------------------------------------------------------------------ Press Return to continue: ^Cthufir@dur:~$ thufir@dur:~$ thufir@dur:~$ cat NetBeansProjects/WeatherTelnet/src/weathertelnet/WeatherTelnet.java package weathertelnet; import java.io.Console; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.net.SocketException; import java.util.logging.Level; import java.util.logging.Logger; import org.apache.commons.net.telnet.TelnetClient; public final class WeatherTelnet implements Runnable { @Override public void run() { new Thread(new Runnable() { @Override public void run() { try { consoleOutput(); } catch (SocketException ex) { Logger.getLogger(WeatherTelnet.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(WeatherTelnet.class.getName()).log(Level.SEVERE, null, ex); } } }).start(); new Thread(new Runnable() { @Override public void run() { consoleInput(); } }).start(); } public void consoleInput() { } public void consoleOutput() throws SocketException, IOException { TelnetClient tc; tc = new TelnetClient(); tc.connect("rainmaker.wunderground.com", 3000); InputStream inputStream = tc.getInputStream(); char ch = (char) inputStream.read(); while (255 > ch && ch >= 0) { PrintWriter foo = c.writer(); foo.print(ch); foo.flush(); ch = (char) inputStream.read(); } } private Console c; public WeatherTelnet() { c = System.console(); run(); } public static void main(String[] args) { new WeatherTelnet(); } } thufir@dur:~$ thufir@dur:~$ but netbeans gives this result: init: deps-jar: Created dir: /home/thufir/NetBeansProjects/WeatherTelnet/build Updating property file: /home/thufir/NetBeansProjects/WeatherTelnet/build/built-jar.properties Created dir: /home/thufir/NetBeansProjects/WeatherTelnet/build/classes Created dir: /home/thufir/NetBeansProjects/WeatherTelnet/build/empty Created dir: /home/thufir/NetBeansProjects/WeatherTelnet/build/generated-sources/ap-source-output Compiling 1 source file to /home/thufir/NetBeansProjects/WeatherTelnet/build/classes Copying 1 file to /home/thufir/NetBeansProjects/WeatherTelnet/build/classes compile: run: Exception in thread "Thread-0" java.lang.NullPointerException at weathertelnet.WeatherTelnet.consoleOutput(WeatherTelnet.java:53) at weathertelnet.WeatherTelnet$1.run(WeatherTelnet.java:21) at java.lang.Thread.run(Thread.java:724) BUILD SUCCESSFUL (total time: 0 seconds) see also: http://stackoverflow.com/questions/2430080/
on netbeans mailing list, I was directed to this bug: https://netbeans.org/bugzilla/show_bug.cgi?id=68770
*** This bug has been marked as a duplicate of bug 68770 ***
The problem is that terminal requires pseudo tty.