TCPMon Download jar does not run on Windows

drewfrisk picture drewfrisk · Apr 22, 2013 · Viewed 7.8k times · Source

I downloaded TCPmon in an effort to try and monitor traffic through WSO2 ESB. However, when I try and execute the jar nothing happens. How can I get the jar to execute?

Answer

drewfrisk picture drewfrisk · Apr 22, 2013

They failed to set the main class properly in the MANIFEST.

Create a bat file that will load the Java environment variable and set the main class.

:checkJava
if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
goto launch

:noJavaHome
echo "You must set the JAVA_HOME variable before running TCPMon."
goto end

:launch
"%JAVA_HOME%\bin\java.exe" -cp ".;tcpmon-1.1.jar" com.codegoogle.tcpmon.MainWindow

https://code.google.com/p/tcpmon/issues/detail?id=15

EDIT

given that my use case was for WSO2 and TCPMon was already included, this wasn't needed. But it's still a useful snippet for the TCPMon download from the google repository.