Unable to test a main() method class using debugger

When I attempt to launch debug for a main() class by right-clicking on the file in the Package view and selecting "Debug", the "Variables" window first lists the message . A "Run Error" dialog then appears stating "Error running Test: Unable to open debugger port : java.net.SocketException "socket closed".

The console window java command shows:
java -Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:2307,suspend=y,server=n -Dfile.encoding=windows-1252 -classpath ... Test

The JDK I am using is 1.4.2_11.

I'm just trying to run a main() method and observe the output in the console using System.out.println() statements. Can someone help me understand what I am doing wrong?

3 comments
Comment actions Permalink

Steven Kerckhof wrote:

When I attempt to launch debug for a main() class by right-clicking on the file in the Package view and selecting "Debug", the "Variables" window first lists the message . A "Run Error" dialog then appears stating "Error running Test: Unable to open debugger port : java.net.SocketException "socket closed".

The console window java command shows:
java -Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:2307,suspend=y,server=n -Dfile.encoding=windows-1252 -classpath ... Test

The JDK I am using is 1.4.2_11.

I'm just trying to run a main() method and observe the output in the console using System.out.println() statements. Can someone help me understand what I am doing wrong?

Could be a local firewall configuration issue, or even an OS problem -
I've had times where Windows has run out of some sort of resources and
refused to allow network ports to open, but if this happens a simple
reboot usually does the trick.

N.

0
Comment actions Permalink

You can also try to switch the "Debugger Transport" from "Socket" to "Shared memory".
See Settings -> IDE Settings -> Debugger

0
Comment actions Permalink

Hi!
I have same problem on java 1.6.0_17
Can you help me ?

pe4enko@pe4enko:~$ sufd
Java(TM) Web Start 1.6.0_17 Launching: /usr/lib/jvm/java6/jre/bin/java
/usr/lib/jvm/java6/jre/bin/java
-Xbootclasspath/a:/usr/lib/jvm/java6/jre/lib/javaws.jar:/usr/lib/jvm/java6/jre/lib/deploy.jar:/usr/lib/jvm/java6/jre/lib/plugin.jar
-classpath
/usr/lib/jvm/java6/jre/lib/deploy.jar
-Djava.security.policy=file:/usr/lib/jvm/java6/jre/lib/security/javaws.policy
-DtrustProxy=true
-Xverify:remote
-Djnlpx.home=/usr/lib/jvm/java6/jre/bin
-Djnlpx.remove=false
-Djnlpx.splashport=46455
-Xdebug
-Xnoagent
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5006
-Djnlpx.jvm=/usr/lib/jvm/java6/jre/bin/java
-Djnlpx.vmargs="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5006"
com.sun.javaws.Main
http://127.0.0.1:18080/docapp-3/app.jnlp

pe4enko@pe4enko:~$ Listening for transport dt_socket at address: 5006

0

Please sign in to leave a comment.