1 Reply Latest reply on Apr 10, 2007 7:14 AM by monkey_woo_too

    accessing a new java object

    manju thammaiah Level 1
      i have a .jar file given by a third party. i never worked with java objects before. any way now i did copy it to right location i think. that is web_root/WEB-INF/lib now i am trying to access i have some problems. i do know the class name but it is not working. now is there a way i can find what classes in it. or can some one give me a working example how to use a java object in CF. thanks.
        • 1. Re: accessing a new java object
          monkey_woo_too
          You can use winrar to look inside a jar file

          Here is some code i use to access a lucene repository:

          <cfset variables.analyzer = createObject("java", "org.apache.lucene.analysis.PerFieldAnalyzerWrapper").init(createObject("java", "org.apache.lucene.analysis.standard.StandardAnalyzer").init()) />
          <cfset variables.analyzer.addAnalyzer("example1", createObject("java", "org.apache.lucene.analysis.KeywordAnalyzer").init()) />
          <cfset variables.analyzer.addAnalyzer("example2", createObject("java", "org.apache.lucene.analysis.KeywordAnalyzer").init()) />
          <cfset variables.analyzer.addAnalyzer("example3", createObject("java", "org.apache.lucene.analysis.WhitespaceAnalyzer").init()) />