• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can't compile ejb java source files using JBoss 5 libraries (javax.ejb does not exist)

 
Anton Shaikin
Ranch Hand
Posts: 65
IntelliJ IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!
I feel so frustrated, that I can't compile simple ejb source files for about 2 days.
So I've got JBoss AS 5 installed and I have my classpath set as .; C:\jboss\lib\concurrent.jar; C:\jboss\lib\jboss-common.jar; c:\jboss\client; c:\jboss\lib\commons-httpclient.jar; C:\jboss\server\all\lib; C:\JBoss\common\lib; C:\JBoss\server\all\deployers\ejb3.deployer; C:\JBoss\server\all\deployers\jboss-aop-jboss5.deployer;
Maybe there's something extra in my classpath, but never mind.
So when I try to run javac in the following manner
C:\Java EE Projects\SimpleSessionApp\javac client\*.java
I get "package javax.ejb does not exist" and "cannot find symbol symbol: class Remote"
What can I do to get it to work?
Please, help me, as I'm completely stuck at this problem.
I know that I should add something to my classpath but what exactly?
Thanks in advance!
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have a couple of directories in the classpath - be aware that that will NOT add the individual jar files in those directories to the classpath. All jar files need to be listed explicitly.
 
Anton Shaikin
Ranch Hand
Posts: 65
IntelliJ IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, but are you aware of what .jar files should I specify in classpath?
Anyway, how can I scan in what jar file the javax.ejb package resides?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On the command line, you can use "jar -tf some.jar" to find out which classes are in a jar file.
 
Anton Shaikin
Ranch Hand
Posts: 65
IntelliJ IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hooray! Finally, I have compiled my classes!
Weird though, that even after setting classpath as an environment variable the compiler output errors (such as package javax.ejb does not exist).
Only after compiling with -classpath flag and explicitly telling compiler where to look for javax.ejb package sources have successfully compiled.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I advise not to ever use the environment variable, it creates all kinds of problems. Just use the -classpath switch, and -for more complex applications with multiple jar files- learn to use and love Ant for all build tasks.
 
Anton Shaikin
Ranch Hand
Posts: 65
IntelliJ IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:I advise not to ever use the environment variable, it creates all kinds of problems. Just use the -classpath switch, and -for more complex applications with multiple jar files- learn to use and love Ant for all build tasks.

Thanks for your advices. I'll try to make use of them.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic