• 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

chapter 10 -->page 804-->classpath ???

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
book k and b 6.0
page 804 last paragraph
"remember when using classpath,
the last directory in the path must be the super-directory of the root directory for the package" and explanation ...

test
|--b.java (public class b extends a { public static void main(String [ ]str){} }) import myapp.utils.*;
|--ws
......|--myapp
..............|--utils
.....................|--a.class (public class a{}) (package myapp.utils)

i applied cp according to book such as

cd test
javac -cp ws b.java // it compiles

java -cp ws user // exception in main --NoClassDefFound



whats missing ? help?
thanks in advance







 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, you have not shown us what the packages are... so we really can't tell if you got the classpath correct. Second, no matter what package b.java is in, there is no way that it will find it in the class path that you specified.

Henry
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic