Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7531203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:06:44+00:00 2026-05-30T05:06:44+00:00

echo $CLASSPATH /home/user/tomcat/lib/server-api.jar echo $JAVA_HOME .:/usr/lib/jvm/java-6-sun but when I try to compile .java which

  • 0

echo $CLASSPATH

  /home/user/tomcat/lib/server-api.jar

echo $JAVA_HOME

  .:/usr/lib/jvm/java-6-sun

but when I try to compile .java which are in class folder

  javac  *.java

I get

  HelloServlet.java:2: package javax.servlet does not exist

and additional 5 similar errors.

I get no errors when

  javac -cp /home/user/tomcat/lib/servlet-api.jar *.java

Why is that? What should I change to make it work without -cp /path?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T05:06:46+00:00Added an answer on May 30, 2026 at 5:06 am

    Looks like your classpath doesn’t actually contain servlet-api.jar. The echo of CLASSPATH shows that it has server-api.jar in the path, but not servlet-api.jar. Try adding servlet-api.jar to your CLASSPATH definition and see if it works then.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<target name=results> <echo message=Calculating QI /> <java jar=jmt.jar fork=true failonerror=true maxmemory=1024m classpath=jmt/jmt> <arg value=-name:KIS/>
Here I check the environment variable CLASSPATH daniel@daniel-laptop:~/ps/clojure/projects/ring-tutorial$ echo $CLASSPATH /home/daniel/ps/clojure/projects/ring-tutorial/src Here I check
Here is a shell script: echo Starting Jarvis Program D. ALICE_HOME=. SERVLET_LIB=lib/servlet.jar ALICE_LIB=lib/aliceserver.jar JS_LIB=lib/js.jar
Is there a default classpath on Mac OS X 10.6? When I echo $CLASSPATH
I have bat file like below with name myBat.bat 1) @echo off set CLASSPATH=%CLASSPATH%;C:\Documents
echo $_POST[name]; //returns the value a user typed into the name field I would
This bash script concatenates the names for jar files to a classpath (variable CP),
I'd want to restrict the maximum heap size for a Java application but it
I have the following ant build.xml : <path id=antclasspath> <fileset dir=lib> <include name=*.jar/> </fileset>
I have the following jars under /Users/joe/.scala/lib: commons-codec-1.4.jar httpclient-4.1.1.jar httpcore-4.1.jar commons-logging-1.1.1.jar httpclient-cache-4.1.1.jar httpmime-4.1.1.jar Below

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.