1

I have to put my Java Library in Coldfusion and my Coldfusion's Java Virtual Machine Path is C:/ColdFusion9/runtime/jre

In which location I should consider placing my Java Library ?

  1. Coldfusion9/wwwroot/WEB-INF/lib

  2. Coldfusion9/runtime/jre/lib

I can see .jar files at both of the above locations. Hence I'm wondering where should I put my downloaded .jar? I will be restarting CF9 after doing this.

More Info: The documentation here says that it should always be in the JVM's classpath as a rule. Could anyone tell me where, or what, is the rule ?

Community
  • 1
  • 1
rocky
  • 435
  • 3
  • 8
  • 18

1 Answers1

6

(This does sound like a duplicate, but my remarks are too long for comments)

Short answer: The simple option is to place the .jar file in {web_root}/WEB-INF/lib and restart.

Longer answer: The thread you referenced says that .jar files must be placed somewhere within the CF class path. In loose terms, "class path" just means a collection of paths that CF is going to search for jars/classes when the server starts.

Technically - you are free to place a jar file just about anywhere you want. As long as it is accessible to the CF Server and that path is included in the jvm.config file. However, there are certain locations which CF checks automatically. So you can just place a jar file in one of those directories and restart. No other changes are needed.

Two of the locations CF checks automatically are:

  • {web_root}/WEB-INF/lib/
  • {web_root}/WEB-INF/classes/

The comment about the "rule" refers to a convention for the /WEB-INF/ folder that specifies .jar files should be placed in WEB-INF/lib/ while individual *.class files (less common) should be placed in WEB-INF/classes/. Since you are using a jar, it would go in WEB-INF/lib/.

For more details about how and where CF searches for jars, see also

Community
  • 1
  • 1
Leigh
  • 28,765
  • 10
  • 55
  • 103