Results 1 to 8 of 8
  1. #1
    slimce is offline Member
    Join Date
    May 2010
    Posts
    5
    Rep Power
    0

    Default Help. Java run time error

    I keep getting this java error and don't know what it means or how to resolve it. Program compiles with javac xxxxxxxxx.java but generates the following error with java xxxxxxxxxxx

    D:\Documents and Settings\Desktop\MyJava>java SecureWebServer
    Exception in thread "main" java.lang.NoClassDefFoundError: SecureWebServe
    Caused by: java.lang.ClassNotFoundException: SecureWebServer
    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)
    Could not find the main class: SecureWebServer. Program will exit.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,457
    Blog Entries
    7
    Rep Power
    20

    Default

    For now, try to start the JVM like this:

    Java Code:
    java -cp . SecureWebServer
    kind regards,

    Jos

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,331
    Rep Power
    25

    Default

    Also make sure the SecureWebServer.class file is there. Do a dir command to show what is in the folder before doing the java command.

    Is the classpath environment variable set? You could set it to . to not have to enter -cp . on your command line.

  4. #4
    slimce is offline Member
    Join Date
    May 2010
    Posts
    5
    Rep Power
    0

    Default

    Thanks Josah for Responding ....the command specified did work but generated this error

    java.io.IOException: Could not open socketjava.io.FileNotFoundException: mystore.ks (The system cannot find the file specified)

    do I need to put Mystore.ks in the bin directory and any link or idea of how to fix this error ll be very much appreciated

  5. #5
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,457
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by slimce View Post
    do I need to put Mystore.ks in the bin directory and any link or idea of how to fix this error ll be very much appreciated
    I don't know where your program is looking for that file; put it there where your program is looking for it. It definitely isn't there now.

    kind regards,

    Jos

  6. #6
    slimce is offline Member
    Join Date
    May 2010
    Posts
    5
    Rep Power
    0

    Default

    Thanks also Norm for responding - the classpath environment variable is set and working properly.......the command specified did work but generated this error posted above

  7. #7
    slimce is offline Member
    Join Date
    May 2010
    Posts
    5
    Rep Power
    0

    Default

    Thanks
    at list I know it’s a path issue.... ll try and figure it out

  8. #8
    slimce is offline Member
    Join Date
    May 2010
    Posts
    5
    Rep Power
    0

    Default

    Thanks Josah & Norm .... got the path issue sorted out and the program is running Properly...

Similar Threads

  1. Replies: 3
    Last Post: 08-23-2011, 12:46 PM
  2. Class Time - represents time of day
    By verbazon in forum New To Java
    Replies: 1
    Last Post: 04-13-2009, 01:06 AM
  3. How to use time in java
    By Manfizy in forum New To Java
    Replies: 3
    Last Post: 03-16-2009, 12:25 PM
  4. Java 1.5 compile time error
    By ank_k in forum New To Java
    Replies: 4
    Last Post: 11-13-2008, 11:12 AM
  5. Replies: 21
    Last Post: 08-01-2008, 11:13 AM

Posting Permissions

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