Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to debug JNLP with Java 8

I have tried all ways

running application as

1) javaws -J-Xdebug -J-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9123 My.jnlp

2) setting the same option in JAVA_TOOL_OPTIONS

3) setting the same option in JAVAWS_VM_ARGS

4) setting the same option (without -J) in Java control panel

Tried the same options with or without Xnoagent

Each and every way, after doing it when I try to connect from eclipse - it cannot connect. When I do netstat -a - it doesn't show anyone listening on 9123.

I am on windows 10

like image 647
user93353 Avatar asked Jul 24 '17 09:07

user93353


1 Answers

The solution reported in Remote debugging java web start under JVM 1.8

is good, but, on windows environment, you have to follow exactly the indication putting everything in a batch file and invoking that one. I have just tried even with java 9 creating a file launchMyJnlp.bat with this content.

setlocal

set JAVAWS_TRACE_NATIVE=1
set JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,address=9999,server=y,suspend=n %JAVA_TOOL_OPTIONS%

"c:\Program Files\Java\jre-9"\bin\javaws my.jnlp

endlocal

Launching >launchMyJnlp.bat I found the application listening on port 9999 has expected!

like image 123
aboupastis Avatar answered Nov 02 '22 23:11

aboupastis