• 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

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

 
Ranch Hand
Posts: 65
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: 65
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: 65
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: 65
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.
 
Make yourself as serene as a flower, as a tree. And on wednesdays, as serene as this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic