How to include .jar files in coldfusion code 

To Integrate our cfm code with paypal jar files we do the
following steps with our local coldfusion server ,and to run and
integrate the paypal Java SDK jar files, I think we need to do the
same process on the server, can you suggest any thing to do the
following setting for my domain on the server, without setting the
class path in coldfusion administrator.
The ColdFusion application server must be configured to know
the location of the PayPal JAR
files, and your ColdFusion Markup (CFM) pages must be
configured with the absolute path to
the PayPal API certificate for the PayPal API user on whose
behalf the calls are made.
1. Install the PayPal Java SDK “Installing the
SDK”.
2. Copy a subset of the Java SDK JAR files to a location
accessible by the ColdFusion
application server. The JAR files are in SDK_root\lib and
their exact names are as
follows:
– bcmail-jdk14-128.jar
– bcprov-jdk14-128.jar
– paypal_base.jar
– paypal_stubs.jar
sax2.jar
– xerces.jar
– xpp3-1.1.3.4d_b4_min.jar
– xstream.jar-1.1.3.jar
3. With the ColdFusion Application Server Administrator, add
the absolute path of the
location you determined in Step 2 to the Java and JVM
CLASSPATH environment variable.
4. Restart the ColdFusion Application Server.
Suggest me how to include .jar files without setting
classpath.

> Suggest me how to include .jar files without setting
classpath.
Copy them to {CF_HOME}\lib, where {CF_HOME} is, for example,
C:\CFusionMX7. Restart Coldfusion.

Similar Messages

  • How to include jar files in jdk1.7

    Please can anybody tell me that how can i include jar files in jdk1.7

    You mean to add a library in NetBeans? If so, click here

  • How to include JAR file as package

    I am trying to code for passing data from an Applet to javascript. It appears the preferred method involves a package netscape.javascript to include support for the JSObject class. found a download of a jar file which contains this package. I am using Sun Creator and JCreator but dont know where to or how to install this package to be available to the compiler. Sorry for the beginner level question but any help is greatlyt appreciated. TIA

    You need to create a project and add the jar to the classpath. Then you can import the required libraries.

  • How to include jar files in ant script for compiling

    i am trying to manually include j2ee.jar for compiling, here is the entire build.xml:
    <?xml version="1.0"?>
    <!--PRIMARY build file for all of dev modual -->
    <project name="com" default="compile.all" basedir="../">
    <path id="project.class.path">
    <pathelement location="lib/"/>
    <pathelement path="${java.class.path}/"/>
    <pathelement path="${additional.path}"/>
    <pathelement path="${CLASSPATH}" />
    <pathelement path="${classpath}" />
    </path>
    <property name="SRCDIR" value="${basedir}/java" />
    <property name="DSTDIR" value="${basedir}/classes" />
    <property name="LIBDIR" value="${basedir}/libs" />
    <property name="JARDIR" value="${basedir}/jars" />
    <property name="DOCDIR" value="${basedir}/docs" />
    <property name="ORACLE.JAR" value="${LIBDIR}/orcl/8.1.7/classes12.zip" />
    <property name="JUNIT.JAR" value="${LIBDIR}/junit/3.7/junit.jar" />
    <property name="CLASSPATH" value="z:/tools/java;${SRCDIR};${DSTDIR};${JUNIT.JAR};${ORACLE.JAR}" />
    <property name="POLICYFILE" value="${SRCDIR}/com/leader/cti/main/ctimain.policy" />
    <property name="DEBUG_FLAG" value="on" />
    <property name="OPTIMIZE_FLAG" value="off" />
    <property name="DEPRECATION_FLAG" value="off" />
    <property name="RMI_VERSION" value="1.2" />
    <!-- builds everything -->
    <target name="compile.all">
    <antcall target="compile.cti"/>
    </target>
    <target name="compile.vbsf" description="Compiles files for vbsf.jar.">
    <mkdir dir="${DSTDIR}"/>
    <copy file="${SRCDIR}/VBSFELK5UD3SWQ2E.class" todir="${DSTDIR}"/>
    <javac srcdir="${SRCDIR}" destdir="${DSTDIR}" classpath="${CLASSPATH}" debug="${DEBUG_FLAG}" deprecation="${DEPRECATION_FLAG}" optimize="${OPTIMIZE_FLAG}" >
    <include name="com/objectmatter/**/*.java" />
    </javac>
    </target>
    <target name="compile.persist" description="Compiles files for persist.jar." depends="compile.vbsf" >
    <javac srcdir="${SRCDIR}" destdir="${DSTDIR}" debug="${DEBUG_FLAG}" deprecation="${DEPRECATION_FLAG}" optimize="${OPTIMIZE_FLAG}" >
    <classpath refid="project.class.path"/>
    <include name="com/leader/persist/**/*.java" />
    <include name="testcom/leader/persist/**/*.java" />
    </javac>
    </target>
    <target name="compile.cti" description="Compiles files for both cti jars." depends="compile.persist,compile.cti.only" />
    <target name="compile.cti.only" description="Compiles files for both cti jars." >
    <javac srcdir="${SRCDIR}" destdir="${DSTDIR}" debug="${DEBUG_FLAG}" deprecation="${DEPRECATION_FLAG}" optimize="${OPTIMIZE_FLAG}" >
    <classpath refid="project.class.path"/>
    <include name="com/leader/cti/**/*.java" />
    <include name="testcom/leader/cti/**/*.java" />
    </javac>
    <rmic classpath="${CLASSPATH}" base="${DSTDIR}" stubversion="${RMI_VERSION}" >
    <include name="com/leader/cti/main/RMICTIService.class" />
    <include name="com/leader/cti/main/RMIConferenceCall.class" />
    <include name="com/leader/cti/main/RMIConferenceCallReservation.class" />
    <include name="com/leader/cti/main/FakeRmiCtiService.class" />
    <include name="com/leader/cti/main/FakeRmiConferenceCall.class" />
    <!--include name="com/leader/cti/main/DerivedQueueReceiver.class"/-->
    </rmic>
    </target>
    <!-- build all dev jars -->
    <target name="jar.all"
    description="Create all jar files"
    depends="jar.vbsf, jar.persist, jar.jeti, jar.service"/>
    <!-- build vbsf.jar -->
    <target name="jar.vbsf"
    description="Create client distribution jar for vbsf code"
    depends="compile.vbsf" >
    <mkdir dir="${JARDIR}" />
    <jar jarfile="${JARDIR}/vbsf.jar"
    basedir="${DSTDIR}" >
    <include name="VBSFELK5UD3SWQ2E.class"/>
    <include name="com/objectmatter/**/*.class" />
    </jar>
    </target>
    <!-- build persist.jar -->
    <target name="jar.persist"
    description="Create client distribution jar"
    depends="compile.vbsf,compile.persist" >
    <mkdir dir="${JARDIR}" />
    <jar jarfile="${JARDIR}/persist.jar"
    basedir="${DSTDIR}" >
    <include name="com/leader/persist/**/*.class" />
    </jar>
    </target>
    <!-- build jeti.jar -->
    <target name="jar.jeti"
    description="Create client distribution jar"
    depends="compile.vbsf,compile.persist,compile.cti" >
    <mkdir dir="${JARDIR}" />
    <jar jarfile="${JARDIR}/jeti.jar"
    basedir="${DSTDIR}" >
    <include name="com/leader/cti/rmiint/*" />
    <include name="com/leader/cti/main/*Stub*" />
    <include name="com/leader/cti/util/**" />
    <include name="com/leader/cti/vru/*" />
    <include name="com/leader/cti/interfaces/*" />
    <include name="com/leader/cti/history/*" />
    <include name="com/leader/cti/autodial/*" />
    </jar>
    </target>
    <!-- build jeti_service.jar -->
    <target name="jar.service"
    description="Create the jar file for the service"
    depends="compile.vbsf,compile.persist,compile.cti" >
    <mkdir dir="${JARDIR}" />
    <copy file="${basedir}/vbsf/cti.schema" tofile="${DSTDIR}/cti.schema" />
    <copy file="${basedir}/vbsf/cti.schema" tofile="/tools/java/com/leader/osapplication/persist/cti.schema" />
    <jar jarfile="${JARDIR}/jeti_service.jar"
    basedir="${DSTDIR}" >
    <include name="com/leader/cti/**" />
    <include name="cti.schema" />
    </jar>
    </target>
    <!-- build jeti.jar, jeti_service.jar -->
    <target name="jar.cti"
    description ="Create client/server jars for cti"
    depends="jar.jeti,jar.service" />
    <!-- clean everything. -->
    <target name="clean">
    <delete dir="${DSTDIR}" />
    <delete dir="${JARDIR}" />
    <delete dir="${DOCDIR}" />
    </target>
    <target name="clean.cti" description="clean cti class files (not jars)">
    <delete dir="${DSTDIR}/com/leader/cti" />
    <delete dir="${DSTDIR}/testcom/leader/cti" />
    </target>
    <!-- Run the gui CTI tests -->
    <target name="test_cti_gui">
    <java classname="junit.swingui.TestRunner" classpath="${CLASSPATH}" fork="yes">
    <arg value="testcom.leader.cti.CTIPackageTest"/>
    <sysproperty key="leader.unique_number_generator.file" value="unique_number_generator_file_test" />
    <sysproperty key="vbsf.repository" value="/tools/java/dev/vbsf" />
    <sysproperty key="vbsf.enableGlobalCaching" value="false" />
    </java>
    </target>
    <target name="test.cti.gui"
    depends="test_cti_gui" />
    <!-- Run the text version of CTI tests -->
    <target name="test">
    <java classname="junit.textui.TestRunner" classpath="${CLASSPATH}" fork="yes">
    <arg value="testcom.leader.cti.CTIPackageTest"/>
    <sysproperty key="leader.unique_number_generator.file" value="unique_number_generator_file_test" />
    </java>
    </target>
    <!-- Run CTI service -->
    <target name="run.service"
    description="run the service normally"
    depends="compile.all" >
    <java classname="com.leader.cti.main.CTIMain"
    classpath="${CLASSPATH}"
    fork="yes" >
    <sysproperty key="java.security.policy"
    file="${POLICYFILE}" />
    <sysproperty key="config.dir"
    value="${SRCDIR}/com/leader/cti/main/" />
    </java>
    </target>
    <!-- Run fake CTI service -->
    <target name="run.service.fake"
    description="run the fake service"
    depends="compile.all" >
    <java classname="com.leader.cti.main.FakeCtiMain"
    classpath="${CLASSPATH}"
    fork="yes" >
    <sysproperty key="java.security.policy"
    file="${POLICYFILE}" />
    <sysproperty key="config.dir"
    value="${SRCDIR}/com/leader/cti/main/" />
    </java>
    </target>
    <!-- Run CTI service emulator -->
    <target name="run.service.emulator"
    description="run the service normally"
    depends="compile.all" >
    <java classname="com.leader.cti.main.CTIMain"
    classpath="${CLASSPATH}"
    fork="yes" >
    <sysproperty key="java.security.policy"
    file="${POLICYFILE}" />
    <sysproperty key="config.dir"
    value="${SRCDIR}/com/leader/cti/main/" />
    <sysproperty key="vru.propertyfile"
    value="emulator.properties" />
    </java>
    </target>
    <!-- Runs the CTI service and emulator -->
    <target name="run.emulator"
    description="run the service and the emulator"
    depends="compile.all" >
    <java classname="testcom.leader.cti.vru.emulator.VRUEmulator"
    classpath="${CLASSPATH}"
    fork="yes" />
    </target>
    <!-- Runs the gui CONCALL testss -->
    <target name="run.gui"
    description="run the concall test gui"
    depends="compile.all" >
    <java classname="testcom.leader.cti.main.SwingClient"
    classpath="${CLASSPATH}"
    fork="yes" >
    <sysproperty key="java.security.policy"
    file="${POLICYFILE}" />
    </java>
    </target>
    <!-- Fires the maptool up. Defaults to CTI`s Schema file. -->
    <target name="maptool" >
    <java classname="com.objectmatter.bsf.mapping.toolgui.MapTool"
    fork="yes"
    classpath="${CLASSPATH}" >
    <sysproperty key="vbsf.repository" value="${basedir}/vbsf" />
    </java>
    </target>
    <target name="javadoc_cti">
    <mkdir dir="${basedir}/docs"/>
    <javadoc packagenames="com.leader.*" classpath="${CLASSPATH}" sourcepath="${SRCDIR}" destdir="${DOCDIR}\cti" author="true" version="true" use="true" windowtitle="Leader CTI API" doctitle="Leader Technologies, Inc" bottom="Copyright &#169; 2005 Leader Technologies Incorporated.<BR>All Rights Reserved." maxmemory="128m">
    <group title="Leader CTI Packages" packages="com.leader*"/>
    </javadoc>
    </target>
    <target name="javadoc_vbsf">
    <mkdir dir="${basedir}/docs"/>
    <javadoc packagenames="com.objectmatter.* " classpath="${CLASSPATH}" sourcepath="${SRCDIR}" destdir="${DOCDIR}" author="true" version="true" use="true" windowtitle="VBSF by ObjectMatter API" doctitle="Leader Technologie, Inc" bottom="Copyright &#169; 2005 Leader Technologies Incorporated.<BR>All Rights Reserved." maxmemory="128m">
    <group title="Objectivity Packages" packages="com.objectmatter.*"/>
    </javadoc>
    </target>
    </project>
    i am getting this:
    compile.all:
    compile.vbsf:
    compile.persist:
    compile.cti.only:
    Compiling 1 source file to C:\Projects\Leader\dev\classes
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:14: package javax.jms does not exist
    import javax.jms.*;
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:17: package javax.jms does not exist
    import javax.jms.Queue;
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:18: package javax.jms does not exist
    import javax.jms.JMSException;
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:19: package javax.jms does not exist
    import javax.jms.Message;
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:28: cannot find symbol
    symbol: class MessageListener
    public abstract class BasicMQReceiverAsyncR implements Runnable, MessageListener
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:44: cannot find symbol
    symbol : class QueueConnectionFactory
    location: class BasicMQReceiverAsyncR
    QueueConnectionFactory queueConnectionFactory = null;
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:45: cannot find symbol
    symbol : class QueueConnection
    location: class BasicMQReceiverAsyncR
    QueueConnection queueConnection = null;
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:46: cannot find symbol
    symbol : class QueueSession
    location: class BasicMQReceiverAsyncR
    QueueSession queueSession = null;
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:48: cannot find symbol
    symbol : class QueueReceiver
    location: class BasicMQReceiverAsyncR
    QueueReceiver queueReceiver = null;
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:49: cannot find symbol
    symbol : class TextMessage
    location: class BasicMQReceiverAsyncR
    TextMessage message = null;
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:406: cannot find symbol
    symbol : class QueueConnectionFactory
    location: class BasicMQReceiverAsyncR
    queueConnectionFactory = (QueueConnectionFactory)
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:408: package javax.jms does not exist
    queue = (javax.jms.Queue) jndiContext.lookup(QUEUE_NAME); //queue1 = (javax.jms.Queue)jndiContext.lookup("MyQueue1");
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:433: cannot find symbol
    symbol : variable Session
    location: class BasicMQReceiverAsyncR
    Session.AUTO_ACKNOWLEDGE);
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:447: cannot find symbol
    symbol : class JMSException
    location: class BasicMQReceiverAsyncR
    catch (JMSException e)
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:461: cannot find symbol
    symbol : class JMSException
    location: class BasicMQReceiverAsyncR
    catch (JMSException x)
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:482: cannot find symbol
    symbol : class BytesMessage
    location: class BasicMQReceiverAsyncR
    if (m instanceof BytesMessage)
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:488: cannot find symbol
    symbol : class BytesMessage
    location: class BasicMQReceiverAsyncR
    BytesMessage bytesMsg = (BytesMessage)m;
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:488: cannot find symbol
    symbol : class BytesMessage
    location: class BasicMQReceiverAsyncR
    BytesMessage bytesMsg = (BytesMessage)m;
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:501: cannot find symbol
    symbol : class QueueSession
    location: class BasicMQReceiverAsyncR
    QueueSession queueSession2 = null;
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:502: cannot find symbol
    symbol : class QueueSender
    location: class BasicMQReceiverAsyncR
    QueueSender queueSender2 = null;
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:510: cannot find symbol
    symbol : variable Session
    location: class BasicMQReceiverAsyncR
    Session.AUTO_ACKNOWLEDGE);
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:514: cannot find symbol
    symbol : class BytesMessage
    location: class BasicMQReceiverAsyncR
    BytesMessage bytesMessage = queueSession.createBytesMessage();
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:523: cannot find symbol
    symbol : variable DeliveryMode
    location: class BasicMQReceiverAsyncR
    DeliveryMode.PERSISTENT,
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:524: cannot find symbol
    symbol : variable DEFAULT_PRIORITY
    location: class com.leader.cti.vru.Message
    Message.DEFAULT_PRIORITY,
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:525: cannot find symbol
    symbol : variable DEFAULT_TIME_TO_LIVE
    location: class com.leader.cti.vru.Message
    Message.DEFAULT_TIME_TO_LIVE);
    C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:529: cannot find symbol
    symbol : class JMSException
    location: class BasicMQReceiverAsyncR
    catch (JMSException x)
    26 errors
    C:\Projects\Leader\dev\java\build.xml:34: The following error occurred while executing this line:
    C:\Projects\Leader\dev\java\build.xml:56: Compile failed; see the compiler error output for details.
    BUILD FAILED (total time: 8 seconds)
    my class path is:
    .;C:\Projects\Leader\prototype\jms\build\classes;C:\Projects\Leader\dev\libs\persist.jar;C:\Projects\Leader\dev\classes;%OPENJMS_HOME%\lib;%OPENJMS_HOME%\lib\antlr-2.7.2.jar;%OPENJMS_HOME%\lib\castor-0.9.5.jar;%OPENJMS_HOME%\lib\commons-codec-1.3.jar;%OPENJMS_HOME%\lib\commons-collections-2.1.jar;%OPENJMS_HOME%\lib\commons-dbcp-1.2.1.jar;%OPENJMS_HOME%\lib\commons-logging-1.0.4.jar;%OPENJMS_HOME%\lib\commons-pool-1.2.jar;%OPENJMS_HOME%\lib\concurrent-1.3.4.jar;%OPENJMS_HOME%\lib\derby-10.1.1.0.jar;%OPENJMS_HOME%\lib\jdbc-2.0.jar;%OPENJMS_HOME%\lib\jms-1.1.jar;%OPENJMS_HOME%\lib\jndi-1.2.1.jar;%OPENJMS_HOME%\lib\jta-1.0.1.jar;%OPENJMS_HOME%\lib\log4j-1.2.11.jar;%OPENJMS_HOME%\lib\openjms-0.7.7-beta-1.jar;%OPENJMS_HOME%\lib\openjms-common-0.7.7-beta-1.jar;%OPENJMS_HOME%\lib\openjms-net-0.7.7-beta-1.jar;%OPENJMS_HOME%\lib\openjms-tools-0.7.7-beta-1.jar;%OPENJMS_HOME%\lib\oro-2.0.8.jar;%OPENJMS_HOME%\lib\spice-jndikit-1.2.jar;%OPENJMS_HOME%\lib\xerces-2.4.0.jar;%OPENJMS_HOME%\lib\xml-apis-1.0.b2.jar;%J2EE_HOME%\lib\j2ee.jar;%J2EE_HOME%\lib
    as you can see j2ee.jar is in %J2EE_HOME%\lib, but still doesn't work. can someone help me?

    <property name="messaging.client.jar.path" value="Location in your local drive" />
    <property name="messaging.client.jar.name" value="nameOfYourFile.jar" />

  • How to include jar file ??

    Hi,
    I want to use some classes from a .jar file in my application. In NT I
    have placed the .jar file in ....iplanet/ias6/ias/lib/java and included
    the path in CLASSPATH variable in .../iplanet/ias6/ias60/lib/IAB .
    I am facing problem in doing the same in Sun Solaris. Can anyone tell me
    where to place the .jar file and how to set the path ? I am using iAS
    SP2 in Sun Solaris.
    Look forward for a reply. Thanks,
    Regards,
    Brijesh

    Modify the kjs script in the .../iplanet/ias6/ias60/bin directory. Look for
    the CLASSPATH= and add your jar accordingly.
    hth
    "brijesh" <[email protected]> wrote in message
    news:[email protected]..
    Hi,
    I want to use some classes from a .jar file in my application. In NT I
    have placed the .jar file in ....iplanet/ias6/ias/lib/java and included
    the path in CLASSPATH variable in .../iplanet/ias6/ias60/lib/IAB .
    I am facing problem in doing the same in Sun Solaris. Can anyone tell me
    where to place the .jar file and how to set the path ? I am using iAS
    SP2 in Sun Solaris.
    Look forward for a reply. Thanks,
    Regards,
    Brijesh

  • How to create jar files from my code?

    Hi, I�m a rookie programmer and i need to create jar files in my application code. Which classes do i need to use?
    Can anybody give me an example?
    Thanx in advance

    Thanx Uwe. You�re right, i�m only trying to create jar
    files (and extract files from a jar file) I will try
    what you told me. Anyway, I have some doubts about how
    to use those classes.Can you give me any example?
    Thanx again!To create jar files use the class JarOutputStream.
    Add a ZipEntry for each entry in the jar file.
    To read jar files use the class JarInputStream and get all JarEntry.
    It should be straight forward.
    Uwe

  • How to includ jar files?

    Hi,
    I am having jar file and iam running that jar file in command prompt using java -jar WorkFlow.jar command. I have to include some additional jar files in classpath while running this WorkFlow.jar file... Anyone please tell me how to include the jar files in java command??
    Thanks,
    Sathish

    Sathishkumar.D wrote:
    Hi,
    I am having jar file and iam running that jar file in command prompt using java -jar WorkFlow.jar command. I have to include some additional jar files in classpath while running this WorkFlow.jar file... Anyone please tell me how to include the jar files in java command??
    Thanks,
    SathishYou can't. The WorkFlow.jar you have them specified in the class path entry in the manifest file.

  • OpenScript/How to add .jar file to Java Code in relative path

    Hi all,
    I want to add a .jar file which can be executed separately (like "java -jar A.jar") to my recorded Java Code.I've read this wiki http://everest2.us.oracle.com/wiki/Generic_JAR_Project about how to add a .jar file to "Assets", however, I cannot figure out how to use the .jarr file in Java code,I mean , how to get this .jar file like the method the databank added in "Assets"?
    Things I did are as followed:
    1.Execute my .jar file in OpenScript Java code with absolute path like this:
    String cmd = "C:\Users\A.jar";
    Runtime.getRuntime().exec(cmd);
    This does work, but must set a absolute path in Java code like "C:\User\A.jar" ,which is not the workaround I want (I need my scripts can be run on other machines).
    2.Try to get its current path with following codes:
    File directory = new File(".");
    String currentPath=directory.getCanonicalPath();
    However,though this can get its absolute path (which is the the project path) in Eclipse like "C:\Users\Workspace\testProject", this only gets "C:\OracleATS\openScript" in OpenScript.
    I thought to copy my .jar file to the project path , got its current path in java code first,then can know the path of .jar file, but this workaround failed because of the above reason.
    I notice that in the "Assets" there are "Databanks","Object Libraries","JAR Files","Scripts". Since the databanks and scripts that added to "Databanks" and "Scripts" can be got or run in Java Code like:
    *getDatabank("DatabankName").getNextDatabankRecord(); String data = eval("{{db.DatabankName.data}}");*
    *or getScript("ScriptName").run();*
    *Is there a method to get and run the jar file added to "Assets\JAR Files" like the above?*
    Thank you very much!
    Regards,
    Angyoung

    Hi DM,
    Thanks for your reply!
    I've found a workaround,which is calling OpenScript's APIs ,such as this.getScriptPackage().getRepository() and this.getScriptPackage().getWorkspace(),etc to locate the .jar file.
    And this workaround can still work even though the script is run on other machine.
    Sorry to reply you so late!
    Regards,
    Angyoung

  • How to include JAR file in NetBean library?

    i have downloaded JavaMail jar file and now i want to include this file into NetBean library. pls help me out.

    You can add the jar file to Netbeans as an external library by choosing 'Tools' on the menu bar and then selecting 'Library Manager'. In there you can give it a name and the path to the jar file. Once it is setup, if you go to your project properties, and click the 'Libraries' option on the left you will be able to add it. Select 'Add Library' and choose the one that you just created, it will now be part of your project.
    Alternatively, if you don't want to set it up as a library in Netbaeans, go straight to the project properties, select 'Libraries' and then select the 'Add Jar/Folder' option, now you can navigate to your jar file and add it to your project.
    For other info about JavaMail: http://java.sun.com/products/javamail/FAQ.html#install

  • How to include .jar file in our classpath

    I want to do serial communication.I have one demo program but in it they mention that set comm.jar file in your class path.Then how can I set comm.jar file in my class path?

    Javapedia: Classpath
    How Classes are Found
    Setting the class path (Windows)
    Setting the class path (Solaris/Linux)
    Understanding the Java ClassLoader
    java -cp .;<any other directories or jars> YourClassName
    javac -classpath .;<any additional jar files or directories> YourClassName.java

  • How to include jar files in WS assembling

    HI, There:
    I have a webservice project works well except I canot include lib files in WEB-INF. I need following dir in war files
    WEB-INF
    --classes/com.xyz.....
    --lib/my.jar
    I use following target in build.xml
    <target name="webservice-setup" depends="setup,compile-webservice">
    <echo message="-----> Assembling the webservice"/>
    <oracle:assemble appName="${app.name}"
    serviceName="${app.name}"
    interfaceName="com.ivgn.protomineWS.service.ProtomineService"
    className="com.ivgn.protomineWS.service.ProtomineServiceImpl"
    input="${bld.webservice.dir}"
    output="${out.dir}"
    ear="${lib.dir}/${ear.name}.ear">
    <classpath>
    <pathelement location="${OC4J_HOME}/webservices/lib/wsa.jar"/>
    </classpath>
    </oracle:assemble>
    </target>
    where can i add the lib directory so that many jar files for this application can get into lib directory. Looks like this "assemble" command has no argument for "lib". The "input" argument only handle the classes files.
    Thanks
    TZhang

    There are two way to do this.
    1) you assemble the .ear file, expand it's content, make modification and re-package using jar command (plain ant style).
    2) instead of using the -ear option, you can use the -war option. It will leave the content in is expanded form, and you can then do the packaging in your own way, after making modifications.
    You may also want to take a look at the 'appendToExistingDDs' flag of the assemble command (see chapter 16 of the user's guide [1]).
    appendToExistingDDs <true|false>
    Determines whether entries for a new Web service will be appended to the existing
    deployment descriptors or whether they will be overwritten. The deployment
    descriptors that can be affected by this argument are oracle-webservices.xml,
    web.xml, and webservices.xml.
    Beware; this style of assembly is a little hard to use, as you cannot re-run the same target twice, without to restore the original files.
    Hope this helps,
    Eric
    [1] http://download-west.oracle.com/otn_hosted_doc/ias/preview/web.1013/b14434.pdf

  • How to include jar files in exporting an .jar with Eclipse

    I would like to add jar libraries into my jar exported in that they are referenced in my java code . how can i do it with Eclipse?
    Thanks for your response.

    You mean to add a library in NetBeans? If so, click here

  • How to refer a .jar file in the code.

    How to refer a .jar file in the code.
    I want to use a library dnsjava.jar, which I download from the internet. I want to know how to refer it
         If I am compiling the code on Solaris
         If I compiling the code on windows using eclipse.
    I added the following line in my code to refer to this library. But it always complains of not found the class
    import org.xbill.DNS.*;
    I tried the following to add this library but did not work
    On eclipse/windows: Went to window-> preferences -> BuildPath _> class path Variable.
    On Solaris: Could not add this library /opt/java_reference/v1.6.0_04/jre/lib. Although I am logged in as root, but not able to add the library there. Complains of Permission denied.

    Set the classpath option when compiling.
    javac -classpath /path/to/lib/dnsjava.jar YourProgram.java
    I don't use Eclipse, but it probably has a library list on your project preferences. Add it there.
    Regards,
    Henrique Abreu

  • Help! How to create Jar file for a packaged class?

    Hi!
    I am new in jar complexities. I made a swing frame that just prompts a JOptionPane when executed. I accomplished the same using jar without packaging my class SwingTest.
    But when i package it, it doesn't run. Can any one tell me how to make jar file of packaged classes and include images in the jar files too!
    Really Thanx!

    Call the Jar from the commandline to see the exceptions thrown.
    java -jar <jarFileName> <className>

  • How to include .jars?

    Hello,
    I have been unable to find out how to include in the .ear file generated by wsgen the supporting .jar files that my Web Service EJB needs.
    I thought this could be done with the "classpath" parameter in the wsgen tag in build.xml, but it doesn't seem to do anything.
    Can someone please provide a hint?
    Thanks,
    Pere

    Hi Pete,
    You mentioned the <wsgen> Ant task, so I'm assuming that you're using WLS 6.1
    An automated way to do this, is to include a series of <exec> Ant tasks after
    the <wsgen> one. These <exec> Ant tasks would call the jar.exe and look something
    like this:
    <exec
    dir="."
    executable="jar.exe"
    failonerror="yes"
    >
    <arg line="xvf ${APPLICATIONS}/MyWS.ear myEJB.jar"/>
    </exec>
    <delete dir="myEJB-jar"/>
    <mkdir dir="myEJB-jar"/>
    <exec
    dir="myEJB-jar"
    executable="jar.exe"
    failonerror="yes"
    >
    <arg line="xvf myEJB.jar"/>
    </exec>
    <copy todir="myEJB-jar">
    <fileset dir=".">
    <include name="jar1-used-by-EJB.jar"/>
    <include name="jar2-used-by-EJB.jar"/>
    </fileset>
    </copy>
    <copy todir="myEJB-jar/META-INF">
    <fileset dir=".">
    <include name="MANIFEST.MF"/>
    </fileset>
    </copy>
    <jar jarfile="myEJB.jar" basedir="myEJB-jar" />
    <exec
    dir="."
    executable="jar.exe"
    failonerror="yes"
    >
    <arg line="uvf ${APPLICATIONS}/MyWS.ear myEJB.jar"/>
    </exec>
    I realize this seems like a lot of steps, but they are at least automated :-)
    Note that the contents of the MANIFEST.MF that you copy in must look like this:
    Manifest-Version: 1.0
    Created-By: Ant 1.4
    Class-path: jar1-used-by-EJB.jar jar2-used-by-EJB.jar
    in order for the EJBs to find the newly included .jar files.
    HTH,
    Mike Wooten
    Pere Torrodellas <[email protected]> wrote:
    Hello,
    I have been unable to find out how to include in the .ear file generated
    by wsgen the supporting .jar files that my Web Service EJB needs.
    I thought this could be done with the "classpath" parameter in the wsgen
    tag in build.xml, but it doesn't seem to do anything.
    Can someone please provide a hint?
    Thanks,
    Pere

Maybe you are looking for

  • How do I use landscape in numbers?

    I just spent 20 dollars to get these apps for school. But when I opened the app it remained in portrait. Which is ver uncomfortable to use at all. Is there a setting I'm supposed to hunt down and tap? Please let me know, and I hope I did not waste my

  • Hierarchical query with multiple roots

    Hi, I'm trying to write a sql query to find blocking lock in database. The idea is to get the blocker in 1st column, comma separated list of waiters in 2nd column and number of waiters in 3rd column. As of now i use below query to get a tree structur

  • Best way to manage a downloaded binary with pacman?

    Hi all, Supposing I downloaded a binary release of some project from a website, what would be the best way to keep track of all of the files using the package manager?  I'm new to PKGBUILDs and such, but my first thought was to write a PKGBUILD with

  • How do i set still frame length default?

    hello, an animator gave me some sequential .png files for a short 5 second clip. they are all still frames, but my final cut keeps importing them each as 10 seconds in length as default. how do i make it one frame each so that when i drag to my timel

  • Runtime Action in Parameter Form

    hello sir/madam I am working in Report 6i .. I am creating a report in which,in the parameter form I am using a textfield for getting input from user..based on the input received from the user I want to display another textfield in the same parameter