• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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

 
Ranch Hand
Posts: 72
IntelliJ IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 72
IntelliJ IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 72
IntelliJ IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 72
IntelliJ IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
This one time, at bandcamp, I had relations with a tiny ad.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic