JMX examples don't work under windows
5 comments
![daniel daniel](http://www.gravatar.com/avatar/6dc7f15cc9e5f5420d97dbb383947f1c?size=64&default=https%3A%2F%2Fwww.bigsoft.co.uk%2Fmedia%2Fshared%2Fglobal%2Favatars%2Fdefault_avatar_unknown.jpg%3Fmtime%3D1519437290)
Comment from: Andrew Swan [Visitor]
![Andrew Swan Andrew Swan](http://www.gravatar.com/avatar/bea965c917f4fa5b4af96fd594281c33?size=64&default=https%3A%2F%2Fwww.bigsoft.co.uk%2Fmedia%2Fshared%2Fglobal%2Favatars%2Fdefault_avatar_unknown.jpg%3Fmtime%3D1519437290)
tilde “~” is Un*x talk for your home directory.
Maybe true, but in Windows it simply indicates that some characters in a path had to be truncated because they exceeded the MS-DOS 8.3 character limit for file and directory names. So:
C:\DOCUME~1\davidne\LOCALS~1\Temp
Is actually an abbreviated version of:
C:\Documents and Settings\davidne\Local Settings\Temp
You’ll find that this directory does in fact exist.
Hope this helps.
Comment from: davidnewcomb [Member]
![admin admin](http://www.gravatar.com/avatar/04d8ea8891106e00c746d31da92351c8?size=64&default=https%3A%2F%2Fwww.bigsoft.co.uk%2Fmedia%2Fshared%2Fglobal%2Favatars%2Fdefault_avatar_unknown.jpg%3Fmtime%3D1519437290)
I understand the DOS abbreviation and that there is a real directory but if your %TMP% folder contains tildes it just doesn’t work!
Comment from: Mika Pussinen [Visitor]
![Mika Pussinen Mika Pussinen](http://www.gravatar.com/avatar/3d51a3a92d826d5f8982398773c47bac?size=64&default=https%3A%2F%2Fwww.bigsoft.co.uk%2Fmedia%2Fshared%2Fglobal%2Favatars%2Fdefault_avatar_unknown.jpg%3Fmtime%3D1519437290)
Thanks for the info. Helped me as well. Before I knew about this TMP environment variable fix only workaround was to tell jmxremote port explicitly in command line and use remote connection facility of jconsole.
- starting of java example app to examine: java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8081 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -jar Notepad.jar
- starting of jconsole: jconsole localhost:8081
But after setting TMP to not tilde path everything worked fine without this remote connection workaround.
Comment from: Mayank [Visitor]
![Mayank Mayank](http://www.gravatar.com/avatar/258ff1746b8ef4fb1385f8ebd39ec3f3?size=64&default=https%3A%2F%2Fwww.bigsoft.co.uk%2Fmedia%2Fshared%2Fglobal%2Favatars%2Fdefault_avatar_unknown.jpg%3Fmtime%3D1519437290)
I am trying to connect to a remote machne using jconsole through windows command line. But not able to connect, here is the command I am using : jconsole host:38686 -J-usernema=admin -J-password=admin
Form is loading...
Hi David,
Thanks for posting that - I’ve put a link to your post here: http://blogs.sun.com/jmxetc/entry/troubleshooting_connection_problems_in_jconsole
I hope it can help other developers!
Cheers,
– daniel