Results 1 to 6 of 6
  1. #1
    osval is offline Member
    Join Date
    Jul 2007
    Posts
    26
    Rep Power
    0

    Default error with import java.io.*

    This error appears when I run a program with java.io imported.
    Java Code:
    Error
    c:\demo\IOStreamDemo.java:2: cannot access java.io
    bad class file: \java\io.class
    class file contains wrong class: io
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    import java.io.*;
    ^
    1 error
    
    Tool completed with exit code 1
    what's the problem?

  2. #2
    brianhks is offline Senior Member
    Join Date
    Jul 2007
    Posts
    135
    Rep Power
    0

    Default

    Lets see the whole code.

  3. #3
    Swamipsn is offline Member
    Join Date
    Jul 2007
    Posts
    74
    Rep Power
    0

    Smile May Be JAR File problem

    java.io class file or related JAR may be damage or corrupt. Pls try to open than using any of text editor, if its open then download the JAR again and copy it to your JDK forlder

  4. #4
    cruxblack is offline Senior Member
    Join Date
    Jul 2007
    Posts
    130
    Rep Power
    0

    Default

    A damaged IO library?
    that's quite rare, which Java version ur using?

  5. #5
    bbq
    bbq is offline Senior Member
    Join Date
    Jun 2007
    Posts
    132
    Rep Power
    0

    Default

    your compiler assumes java.io is a class, not a package.
    We may need to see your real code that has generated the error.

    Reinstalling JDK etc. are irrelevant if other API packages can be imported normally.

  6. #6
    fatima is offline Member
    Join Date
    May 2010
    Posts
    1
    Rep Power
    0

    Default

    Faire un programme qui copie un fichier quelconque du disque vers une disquette (ou disque amovible) . Avant de copier, le programme doit vérifier si l’espace disponible sur la disquette est suffisant, et si le fichier existe déjà. Il doit permettre aussi d’afficher le contenu du répertoire résultat.


    Langage et environnement : Le programme doit être écrit en java sur le système d’exploitation Ubuntu.

Similar Threads

  1. import statement.
    By diRisig in forum New To Java
    Replies: 2
    Last Post: 02-08-2008, 01:34 AM
  2. Replies: 2
    Last Post: 11-24-2007, 07:25 AM
  3. how to import jface in java swt
    By rajaletchumy in forum New To Java
    Replies: 1
    Last Post: 08-08-2007, 01:31 AM
  4. java.util.DateFormat not found in import
    By christina in forum New To Java
    Replies: 2
    Last Post: 08-05-2007, 11:31 PM
  5. The import java.util.Scanner cannot be resolved
    By Heather in forum Advanced Java
    Replies: 1
    Last Post: 07-08-2007, 02:05 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
  •