CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2006
    Posts
    37

    Error in Java files

    When I try to compile Java classes that have package statements in it, I get an error because it is not properly stored in the proper packages as named in the package statement. When I install these classes into their appropriate packages, is it supposed to be correct or is there anything else I have to do to set the packages properly or configure anything else in those Java files?

  2. #2
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: Error in Java files

    Java source files and class files should sit in a directory hierarchy that mirrors their package hierarchy, usually with source and class files in separate directory trees.

    The parent directory of the class files directory hierarchy should appear on the classpath.

    It is quite unusual to get the problem you describe as Java source and class files are usually supplied with their relevant directory paths (e.g. in zip files, or in jar files).

    The sooner you start to code, the longer the program will take...
    R. Carlson
    Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured