LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 12-07-2012, 08:07 PM   #1
Whatif
Member
 
Registered: Nov 2010
Distribution: VectorLinux
Posts: 87

Rep: Reputation: 0
javax.servlet does not exist


Hello,

I'm trying to set up a tomcat server to develop java applications. I install CentOS 6.3 and included java and tomcat packages during installation. When I tried to compile a simple servlet, I got javax.servlet does not exist. What should I do?

Where should I place the .class servlet? The book I'm reading about servlets is saying one thing, the I find yet other things online. I don't want to mess the settings up. I found and online poster suggesting to create a folder under /usr/share/tomcat6/webapp and move all the .class there and it will work without any further settings. Is this true?

Thank you very much,
Mike
 
Old 12-08-2012, 09:30 PM   #2
Whatif
Member
 
Registered: Nov 2010
Distribution: VectorLinux
Posts: 87

Original Poster
Rep: Reputation: 0
I'm getting closer to getting it to work but need help please. I need to set the JAVA_HOME path. Here is what I tried:

vi ~/.bash_profile

I didn't find an entry for JAVA_HOME. So I tried echo $ JAVA_HOME , I got -Home

A website suggested I add export JAVA_HOME=/usr/java/jdk1.5.0_07/bin/java to the .bash_profile file. I couldn't find the /usr/java directory but I found the following:

usr/share/java
usr/share/java 1.3.1
usr/share/java 1.4.0
usr/share/java 1.4.1
usr/share/java 1.4.2
usr/share/java 1.5.0
usr/share/java 1.6.0
usr/share/java 1.7.0

When I type java -version at command line, it got java version "1.6.0_24"

Should I add export JAVA_HOME=/usr/share/java 1.6.0 to .bash_profile?

The .bash_profile file has the following 2 lines:

PATH=$PATH:$HOME/bin
export PATH

When I typed echo $PATH , the output was

/usr/lib/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/mike/bin

how do I add /usr/share/tomcat6/lib to the path to get java to compile my servlet?
 
Old 12-10-2012, 05:50 AM   #3
aegisisc
LQ Newbie
 
Registered: Nov 2012
Posts: 3

Rep: Reputation: 0
Re:-

Using the HttpSession interface of the The Java Servlet Specification is one of the possible ways of maintaining the sessions more effectively and far more easily. All the J2EE compliant containers have the implementation of the underlying classes and the user simply need to call the APIs to use the services.

All your query about Java Development are welcome.

Thanks.
 
Old 12-10-2012, 01:02 PM   #4
Whatif
Member
 
Registered: Nov 2010
Distribution: VectorLinux
Posts: 87

Original Poster
Rep: Reputation: 0
I edited the export line in ~/.bash_profile from

PATH=$PATH:$HOME/bin
export PATH

to

PATH=$PATH:/usr/share/tomcat6/lib/tomcat6-servlet-2.5-api-6.0.24.jar:/usr/share/tomcat6/lib/tomcat6-jsp-2.1-api-6.0.24.jar:/usr/share/tomcat6/lib/tomcat6-el-2.1-api-6.0.24.jar:$HOME/bin
export PATH

restarted the computer but still I get the same error " javax.servlet does not exist"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
package javax.mail does not exist for centos 6.2 newbie14 Linux - Software 9 05-21-2012 02:04 AM
package javax.servlet does not exist on Fedora 10 / Tomcat 6 martijnburger Linux - Server 4 01-10-2009 06:18 PM
Tomcat: package javax.servlet does not exist xpucto Linux - Software 0 03-21-2006 07:45 AM
what is import javax.swing.*; Dutchman Programming 4 06-16-2005 11:12 AM
getting javax.swing.* to appear student04 Programming 8 10-05-2004 11:06 AM


All times are GMT -5. The time now is 03:36 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration