• 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

Package problems with classpath...sob!

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm having major problems with packages and my classpath. I'm using JDK1.4 under Windows XP Pro.
Here is my current directory structure.
My package class files are kept in H:\Java\commonfiles
My class file is kept in H:\Java\programs\OracleDataConnection
I run the executable class using....
java -classpath h:\Java\commonfiles\classes12.zip;h:\Java TryOracleConnection
The classes12.zip is the path to the JDBC drivers, which I am using to connect to an Oracle database. I can successfully connect to the database. I'm using a LinkedHashMap to store each record row returned and storing that in a List.
However, when I run my executable class, I get a ClassNoDefFound error on java/util/LinkedHashMap!
WTF? I've included "import java.util.*;" in both the package class file I'm using and the calling class (which gets the returned List). Just to be doubly sure, I've also included "import java.util.LinkedHashMap;" in both places as well.....but no luck.
I know I must be doing something wrong, but I can't help wishing my department had gone down the .NET route instead of Java. This is utterly insane just to get a simple program running. I'm starting to hate Java.
Please help?
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perhaps you're compiling under JDK 1.4, but running with JDK 1.3 or earlier; LHM was introduced in 1.4. Try "java -version" just to make sure.
 
JBaker
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That was it. Thanks
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic