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

    'class' and 'jar' files

    I have '.class' extension files and jar files for a system that I am going to develop. Where should I locate these files?

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

    Re: 'class' and 'jar' files

    They should go on the project classpath. Physically, it's best to put them in a directory somewhere within the project directory. There are no reules about the directory names, but it pays to be consistent. Class files compiled from project source code usually go in a directory called 'classes', library files such as jars and external class files can go in a directory called 'lib' or 'libs' or 'deps' (short for 'dependencies'). If you have standalone .class files, they'll need to sit in a directory hierarchy that corresponds to their package hierarchy, and the directory that contains that hierarchy is what should go in the classpath, e.g:
    Code:
    c:\projects				 - development directory
    c:\projects\aProject			 - project directory
    c:\projects\aProject\classes		 - project classes
    c:\projects\aProject\source		 - project source
    c:\projects\aProject\lib		 - libraries
    c:\projects\aProject\lib\foo.jar	 - jar file
    c:\projects\aProject\lib\bar.jar	 - jar file
    c:\projects\aProject\lib\com\zork\frab.class - class file
    c:\projects\aProject\lib\com\wep\smot.class  - class file
    classpath = c:\projects\aProject\lib;c:\projects\aProject\lib\foo.jar;c:\projects\aProject\lib\bar.jar
    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