• 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

how to impoet selfmade package

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My all java programms are placed in my d:\jprog directory.
java2 is installed in d:\jdk1.1.2. I made a package jprog.utils
which have a Html class,placed in d:\jprog\utils I am trying to import this package (import jprog.utils.*) in the class Registration.java placed in d:\jprog directory but when i compile it, error is displayed that package import jprog.utils not found in import
my autoexec.bat is like this:
path=d:\jdk1.2.1\bin
set classpath=.;d:\jprog\utils;%CLASSPATH%
what is the solution
MK
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maheshwari,
Try this instead :

The classpath that needs to be specified is the root directory of where your package will be found... i.e. directory before your package specification starts. If your classes were in the d:\dir1\dir2\jprog\utils directory and your package spec. was jprog.util you would have to set your classpath to include d:\dir1\dir2\ (Confusing, I know, but that's the way it's done...)
HTH,
-Nate
[This message has been edited by Nathan Pruett (edited February 15, 2001).]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic