This week's giveaway is in the Java/Jakarta EE forum.
We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line!
See I want to install some custom classes. Actual Bruce Eckel's by permission. I am wondering where the java jdk classes live and where I should start my \com\... class library tree. I have tried many locations and each time I am informed that 'package com\bruceeckel\swing' does not exist. Here is what I've tried:
I have the class (Console) in a subdirectory as specified in the package statement. I have put the com\... below my classpath directory, in the jdk below the libs, in the windows directory below java classes.
So my question is where do I put it or what am I doing wrong?
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The location is based on the CLASSPATH variable. If the CLASSPATH is pointing to /java/lib then you need to place your directory in that directory so that you end up with: /java/lib/com/bruceeckel/swing
Stephen Bridgett
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm Tom
My 3rd party class called Console is located at
and is called Console.class
I compile my app in a separate directory but the first directory of my classpath is '.'
Any suggestions?
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Please bear in mind that Java is case-sensitive so your directories and filenames should always exactly match the names of packages and classes.
2. I'm worries that you seem to be confusing PATH and CLASSPATH. PATH is used by The operating system or command shell to locate executable programs and batch files. CLASSPATH is used by the Java virtual machine to load classes. In most systems only executable programs and batch files (such as "java.exe") should exist in the "bin" directory. Your class files should be in a separate directory structure (say d:\java). So your settings would look something like:
and your files would be located, for example:
you should then be able to run the Console class by typing
java com.bruceeckel.console.Console
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!