This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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
  • 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: 43016
76
  • 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 Oracle Java
  • 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: 43016
76
  • 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 Oracle Java
  • 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: 43016
76
  • 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 Oracle Java
  • 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.
 
Are you okay? You look a little big. Maybe this tiny ad will help:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic