File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Can Servlet be compiling on command prompt? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Can Servlet be compiling on command prompt?" Watch "Can Servlet be compiling on command prompt?" New topic
Author

Can Servlet be compiling on command prompt?

Paul Okeke
Ranch Hand

Joined: May 16, 2009
Posts: 58
I just finished with J2SE & now into J2EE. I have installed JDK & JRE 1.6, Oracle 10g DataBase and SDK 1.5 which is boundled with Sun Application Server (Grass Fish 2v) JavaDB 10.....
I have set the follow in my classPath in my Environment Variable:

"C:\oracle\product\10.1.0\db_1\jdbc\lib;
C:\oracle\product\10.1.0\db_1\jdbc\lib\ojdbc14.jar;
C:\oracle\product\10.1.0\db_1\bin;C:\Program Files\Java\jre6\bin\client;
C:\Program Files\Java\jre6\bin;C:\Sun\SDK;
C:\Sun\SDK\bin;C:\Sun\SDK\lib\ant;
C:\Sun\SDK\lib\ant\bin;
C:\Program Files\Java\jdk1.6.0_14\bin;"

But yet i can't compile any Servlet or any Java Class that imports class from J2EE 1.5 API.

What classPath setting that are necessary for compiling Classes with imported J2EE 1.5 API Classes on the command Prompt?

If try doing this it complains of not seeing the these classes from J2EE 1.5 API.


OCJP 1.6
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
That classpath is seriously messed up. Only individual jar files (like ojdbc14.jar) and directories that contain loose class files should be in it. From the looks of it, I think that none of the directories in there should be in it.

The file you actually need is called j2ee.jar and comes with any JEE application server (like GlassFish). If you're just interested in servlets, then any servlet container (like Tomcat) has the necessary file; it's generally called servlet-api.jar, and in Tomcat's case it's in the TOMCAT_HOME/common/lib directory.

Moving to a more appropriate forum, since the question has nothing to do with ORM.


Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can Servlet be compiling on command prompt?
 
Similar Threads
when i try run: weka.jar i get these error: "Error: Could not find Java 2 Runtime "
need to know about classpath and path variable
JDBC Connectivity to Oracle 11g on Windows 7
APR based Apache Tomcat Native library which allows optimal performance in production environments w
Installed Oracle 10g in my Local system and now I am having problem connecting to it