• Post Reply Bookmark Topic Watch Topic
  • New Topic

How do I set the classpath for J2EE apis?  RSS feed

 
Akhilesh Yadav
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
import java.rmi.RemoteException;
import javax.ejb.CreateException;
import javax.ejb.EJBHome;


public interface AdderHome extends EJBHome {
Adder create () throws RemoteException, CreateException;
}
------------------------------------------------------------------
when i Complie this Programm in command prompt it gives me Error the follwing Errors
----------------------------------------------------------

C:\jboss-3.2.4RC2\classes>javac AdderHome.java
AdderHome.java:2: package javax.ejb does not exist
import javax.ejb.*;
^
AdderHome.java:6: cannot resolve symbol
symbol : class EJBHome
location: interface AdderHome
public interface AdderHome extends EJBHome {
^
AdderHome.java:7: cannot resolve symbol
symbol : class Adder
location: interface AdderHome
Adder create () throws RemoteException, CreateException;
^
AdderHome.java:7: cannot resolve symbol
symbol : class CreateException
location: interface AdderHome
Adder create () throws RemoteException, CreateException;
^
4 errors

plz explain me wht to do to remove this error

[ April 12, 2006: Message edited by: Akhilesh Yadav ]
[ April 12, 2006: Message edited by: Mark Spritzler ]
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't have the ejb classes on your classpath.
 
Akhilesh Yadav
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do i set classpath
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has nothing to do with J2EE, it is just basic Java. How are you compiling your classes? Command-line? IDE?

Assuming command-line, javac takes a -classpath argument that you can use to provide the classpath to compile with. Example:
javac -classpath .;c:\somelocation\j2ee.jar *.java
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!