yuzhougit / tcpmon

Automatically exported from code.google.com/p/tcpmon

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Downloaded jar will not run

GoogleCodeExporter opened this issue · comments

What steps will reproduce the problem?
1. Downloading the jar
2. Running it locally
3.

What is the expected output? What do you see instead?
Expect to run. Runs from web.
Failed to load Main Class Manifest attribute from the jar.

What version of the product are you using? On what operating system?


Please provide any additional information below.


Original issue reported on code.google.com by Enlighte...@gmail.com on 2 Dec 2011 at 10:27

Attachments:

Windows 7 64bit Ultimate.

Original comment by Enlighte...@gmail.com on 2 Dec 2011 at 10:28

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

Simply create a "launch.bat" file next to the JAR and copy paste this line into 
:
java -cp ".;tcpmon-1.1.jar" com.codegoogle.tcpmon.MainWindow

Also, don't attach the whole software to your comment :-D

For devs :
- Set the correct main class in the MANIFEST
OR
- Bundle a pre made BAT file and the jar in a zip file
OR
- Clearly document that (we aren't all JAVA devs guy) 

Original comment by programa...@gmail.com on 9 Aug 2012 at 6:15

[deleted comment]
I tried the batch file fix listed above, but it did not work for me. I am 
running version 1.1 on XP SP3. The batch causes a window to open then close 
before I can see anything in it. The web version runs fine.

If I put the command from the batch into a command prompt, I receive:

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/codegoogl
e/tcpmon/MainWindow (Unsupported major.minor version 48.0)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Original comment by ljc...@gmail.com on 9 Aug 2012 at 5:48

Type in a command prompt : 
java -version

On my computer it gives among other things :
java version "1.7.0_04"

"Simply" update your java installation : http://java.com/en/download/index.jsp

Also, you can improve the "launcher" by doing this :
1.Right clikc on jar
2.Select "create shortcut"
3.Right click shortcut
4.Select "Properties"
5.In target type in :
 C:\Windows\System32\javaw.exe -cp ".;tcpmon-1.1.jar" com.codegoogle.tcpmon.MainWindow
5. Apply and close

Now you can double click your new shortcut and enjoy tcpmon!

Original comment by programa...@gmail.com on 22 Aug 2012 at 6:36

I also cannot run it.

Doing this didn't work:

$ java -cp ".;tcpmon-1.1.jar" com.codegoogle.tcpmon.MainWindow
Exception in thread "main" java.lang.NoClassDefFoundError: 
com/codegoogle/tcpmon/MainWindow
Caused by: java.lang.ClassNotFoundException: com.codegoogle.tcpmon.MainWindow
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

I am running Mac OS X 10.7.4, Java 1.6.0_37.

Original comment by hekevint...@gmail.com on 12 Dec 2012 at 6:55