Results 1 to 5 of 5
  1. #1
    shwein is offline Member
    Join Date
    Sep 2008
    Posts
    38
    Rep Power
    0

    Default classpath problem

    hi
    iv exported a project as a runnable jar file, but when i try to run it it shows a class not found exception...

    -jar HTTPserver
    -com
    -HTTPserver
    -HTTPserver.class
    -META-INF
    -manifest file

    manifest file details->

    Manifest version 1.1
    Class-Path: .
    Main Class: com.HTTPserver.HTTPserver

  2. #2
    angryboy's Avatar
    angryboy is offline Senior Member
    Join Date
    Jan 2009
    Posts
    742
    Rep Power
    6

    Default

    can you post the exception as well? the more detail the better.
    USE CODE TAGS--> [CODE]...[/CODE]
    Get NotePad++ (free)

  3. #3
    shwein is offline Member
    Join Date
    Sep 2008
    Posts
    38
    Rep Power
    0

    Default

    thanks for reply
    the full error is:

    Exception in thread "main" java.lang.NoClassDefFoundError: HTTPserver
    Caused by: java.lang.ClassNotFoundException: HTTPserver
    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)
    Could not find the main class: HTTPserver. Program will exit.

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

  5. #5
    shwein is offline Member
    Join Date
    Sep 2008
    Posts
    38
    Rep Power
    0

    Default

    yes, its in the package, i ve checked it many times.
    "classpath = . " should i give in a absolute path in the manifest file?
    i also tried running it with the -classpath(absolute path) flag, but that also results in the same error.
    I find it very strange...

Similar Threads

  1. j3d classpath
    By sales1 in forum New To Java
    Replies: 3
    Last Post: 12-23-2008, 02:51 AM
  2. Problem with CLASSPATH for STRUTS
    By bhupal4all in forum Web Frameworks
    Replies: 2
    Last Post: 11-07-2008, 06:48 AM
  3. Classpath
    By Preethi in forum New To Java
    Replies: 5
    Last Post: 06-20-2008, 10:00 AM
  4. Classpath on mac osx
    By jacobb in forum JDBC
    Replies: 0
    Last Post: 06-12-2008, 10:41 PM
  5. GNU Classpath 0.96.1
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 11-01-2007, 05:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •