Java Library with in Java Scope?

Hello experts ,

i am trying to utilise Java code inside UiPath

How do I properly initialize and use a Java library within the Java Scope?

Hi @diyakapoor

Check the below thread

Regards,

Hi @diyakapoor ,

To initialize and use a Java library within the Java Scope in UiPath, follow these steps:

  1. Add the Java Scope Activity: Drag the Java Scope activity into your workflow. Set the Java Class Path property to the path of your Java library (.jar file).
  2. Load the .jar File: Within the Java Scope, use the Load Jar activity to load your .jar file. Specify the path to your .jar file in the activity properties.
  3. Invoke Java Methods or Create Java Objects: After loading the .jar file, you can use the Invoke Java Method activity to call methods from your Java classes or the Create Java Object activity to instantiate Java objects.

Here is a simple example:

<Java Scope JavaClassPath="C:\path\to\your\library.jar">
  <Load Jar JarFilePath="C:\path\to\your\library.jar" />
  <Create Java Object ClassName="com.example.YourClass" Result="yourJavaObject" />
  <Invoke Java Method TargetObject="yourJavaObject" MethodName="yourMethod" Result="yourMethodResult" />
</Java Scope>

Regards
Sandy

Thanks for detailed explanation @sandyarpa767

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.