zoukankan      html  css  js  c++  java
  • CLASSPATH, Java Buld Path (eclipse), and WEBINF\LIB

    The CLASSPATH you set in your environment affects only standalone Java applications, i.e. ones you run from a command prompt or an icon. As you've noticed, Eclipse ignores this. It sets up its own per-project classpaths.

    javac and java, if called from the command prompt, should/may honor this path, but it's no longer considered great practice to do this. It's turned out that every app needs its own set of stuff, so a global CLASSPATH isn't really doing any of them any good. Modern practice is to simply specify the classpath with the-cp option on the command line for javac or java.

    A standalone Web Application server will also set up its own classpath. From the command line or GUI, WebAppServers are usually started by a script (.BAT or .sh) that sets up a classpath using -cp. Tomcat has a directory called common or common/lib where it expects to see libraries that should be available the the server and all programs running under it. But you will generally not need/want to mess with this, as it's customaries for applications to provide their own library collectons in WEB-INF/lib.

    So for a Web app, you'd put your varous jars into the lib directory, under WEB-INF, assuming Eclipse pre-builds such a directory structure for you.

    All the libs you need also need to be made known to Eclipse. In the Project Explorer, I select the whole slew of them at once, right-click and select Build Path | add to build path. That's easier than messing with Eclipse's project build path manually.

  • 相关阅读:
    枚举类
    泛型数组列表
    方法参数
    给一个数字和列表,判断列表中是否存在两个元素之和等于这个数字,并好之两个数的坐标
    selenium.common.exceptions.ElementNotVisibleException: Message: element not interactable报错
    python-selenium提供的execute_script调用js操作
    xlrd读取excel数据封装
    0531-练习题 os.system
    0528 文件操作习题
    05/17
  • 原文地址:https://www.cnblogs.com/feiling/p/2512101.html
Copyright © 2011-2022 走看看