• Post Reply Bookmark Topic Watch Topic
  • New Topic

package javax.ejb does not exist...please help!  RSS feed

 
Tink Travers
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello all,
I am trying to compile my first EJB application but the compiler cannot find the javax.ejb package. I already have J2SE SDK installed and configured...it works fine. I suspect that this error is telling me that my CLASSPATH is not set properly but after lots of tweaking I can't figure out how to set it properly.
thanks in advance...Tink
here is an excerpt from my autoexec.bat file:
SET PATH=C:\JDK1.3.1_02\BIN;%PATH%
SET PATH=C:\J2SDKEE1.3.1\BIN;%PATH%
SET CLASSPATH=.;C:\jdk1.3.1_02\lib\tools.jar;C:\j2sdkee1.3.1\lib;%CLASSPATH%
there are 5 five jars in Directory of C:\j2sdkee1.3.1\lib
01/17/2002 03:52 AM 8,067 ejb10deployment.jar
01/17/2002 03:52 AM 4,701 j2ee-ri-svc.jar
01/17/2002 03:52 AM 6,809,949 j2ee.jar
01/17/2002 03:52 AM 2,234,866 j2eetools.jar
01/17/2002 03:52 AM 402,999 jhall.jar
I tried running jar -tf to view the contents of the files but they streamed by too quickly.
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tink,
If you want JAR files on your CLASSPATH, then you need to include the name of the JAR file (not just the directory where it is located).
Have you read How Classes are Found (in the java SDK documentation)? I suggest you also read The extension mechanism - overview and caveats.
Good Luck,
Avi.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Tink!
If you adjusted your CLASSPATH setting a little bit to include C:\j2sdkee1.3.1\lib\j2ee.jar then I'd bet that you'd have resolved the issue of the missing javax.ejb package.
The thing to note is that when you included C:\j2sdkee1.3.1\lib in your CLASSPATH, it didn't include any of the JAR files in that directory - it only included any classes found in that directory (or in the appropriate subdirectory in the case of packaged classes). You likely don't need this directory in your CLASSPATH setting.
 
Tink Travers
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dirk/Avi
I am happy to report that everything works now. the links were helpful and the problem ended up being exactly what Dirk suspected: when I specified the -classpath c:j2sdkee1.3.1\lib\j2ee.jar instead of
-classpath c:j2sdkee1.3.1\lib
the compiler found all of the classes that it needed.
onward and upward!
Tink "Greenhorn" Travers
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!