LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 03-27-2005, 09:56 PM   #1
os2
Member
 
Registered: Dec 2003
Location: Canada
Distribution: openSUSE Tumbleweed
Posts: 209

Rep: Reputation: 30
Problem with import (CLASSPATH, JAVAPATH?)


hi

i use suse 9.2 (linux) and java 1.5

i have some environnement variable

Code:
JRE_HOME=/usr/lib/jvm/java/jre
JAVA_BINDIR=/usr/lib/jvm/java/bin
JAVA_HOME=/usr/lib/jvm/java
SDK_HOME=/usr/lib/jvm/java
JDK_HOME=/usr/lib/jvm/java
JAVA_ROOT=/usr/lib/jvm/java
i use tomcat

when i compile a java class with:

import javax.servlet.*;
import javax.servlet.http.*;

i get:
Code:
package javax.servlet does not exist
import javax.servlet.*;
^
package javax.servlet.http does not exist
import javax.servlet.http.*;
surely it's a classpath or javapath problem?

any idea?
 
Old 03-28-2005, 04:12 AM   #2
huibert.alblas
Member
 
Registered: Jan 2004
Location: Duesseldorf /Germany
Distribution: Gentoo amd64 / Debian
Posts: 226

Rep: Reputation: 30
The package javax.servlet.* should be in your classpath while compiling.
AFAIK This package is not included in Java 1.5 but is part if the tomcat package.
You should exapnd you classpath to include servlet.jar from tomcat,
or you could symlink the tomcat servlet.jar into your java directory (this should be $JAVA_HOME/lib)

Are you using an IDE, or compiling manually?
 
Old 03-28-2005, 08:33 AM   #3
os2
Member
 
Registered: Dec 2003
Location: Canada
Distribution: openSUSE Tumbleweed
Posts: 209

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by huibert.alblas
The package javax.servlet.* should be in your classpath while compiling.
AFAIK This package is not included in Java 1.5 but is part if the tomcat package.
You should exapnd you classpath to include servlet.jar from tomcat,
or you could symlink the tomcat servlet.jar into your java directory (this should be $JAVA_HOME/lib)

Are you using an IDE, or compiling manually?
i compile manually

i have servlet.jar -> /usr/share/java/servlet.jar
 
  


Reply



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
subversion (import - co problem) os2 Linux - Software 0 08-17-2005 03:36 PM
Open Office Import Data Problem eggoz Linux - Software 1 07-26-2005 05:45 PM
Import sys ?bash: import: command not found joirnange Linux - Newbie 4 12-28-2004 10:33 PM
help classpath problem j2sdk1.4.2_04 antony_csf Linux - Software 3 06-17-2004 12:46 AM
up2date problem: 'import site" failed docli Linux - Newbie 1 12-05-2003 09:40 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:38 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration