• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

-classpath option and jar files

 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I've a little confussion regarding the combination of package statements and the jar files.

Let suppose we have created a jar file for a particular directory containing many class files as well as directories.

1.Now if the class file contains any package statement then do we have to supply the relative path on the command prompt or not?
2.If the class file is inside a directory then what do we have to do?

Thanks
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you create a jar file..the classes inside the jar file will be kept in the relative dirs.
e.g. suppose your class contains the following package stmt.

package com.java.yourname;
public class MyClass{}

Then inside the jar file the relative location of the file MyClass.clas should be com/java/youname/MyClass.class
This you can see by openning the jar file in winzip.

Let me know I am wrong.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic