How to compile a servlet for Tomcat in command line? error: package javax.servlet does not exist

前端 未结 4 1310
孤独总比滥情好
孤独总比滥情好 2021-01-03 09:37

I\'ve got this error message when I compiled a Java file :

error: package javax.servlet does not exist

I installed a big .SH file for Jave

4条回答
  •  借酒劲吻你
    2021-01-03 10:13

    Read about java class paths here on Wikipedia.

    Ready closely the last paragraph under "Overview and architecture".

    In your example

    The javax.servlet package is not part of the bootstrapped or extension packages, so it must be added manually to your classpath. ALJI has shown you how to do this from the command line. The Wikipedia link above also provides examples.

    Recommendation

    Everyone hits these types issues when starting a new language. Google is full of tutorials that will help you gain a basic understanding of Java class paths.

提交回复
热议问题