# Pega infinity 23 can call java method and write java code or not?

**URL:** <https://forums.pega.com/t/pega-infinity-23-can-call-java-method-and-write-java-code-or-not/5636>\
**Category:** General\
**Tags:** java-and-activities, pega-infinity\
**Created:** [December 17, 2023, 2:29am UTC](https://forums.pega.com/t/pega-infinity-23-can-call-java-method-and-write-java-code-or-not/5636 "2023-12-17T02:29:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SAHARACH](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@SAHARACH](https://forums.pega.com/u/SAHARACH)\
**Post date:** [December 17, 2023, 2:29am UTC](https://forums.pega.com/t/pega-infinity-23-can-call-java-method-and-write-java-code-or-not/5636/1 "2023-12-17T02:29:35Z")

</div>

if can . we can still using java call in activity step?

please explain and capture screen to call java for infinity 23

---

<div class="post-metadata">

**Author:** ![P.Siva.Praveen](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/p.siva.praveen/32/22985_2.png) [@P.Siva.Praveen](https://forums.pega.com/u/P.Siva.Praveen)\
**Post date:** [December 17, 2023, 5:35am UTC](https://forums.pega.com/t/pega-infinity-23-can-call-java-method-and-write-java-code-or-not/5636/2 "2023-12-17T05:35:41Z")

</div>

@SAHARACH

Instead of writing the java step in activity lets use the function to write the java code and the call the function using the call-function method in activity. This way we can also remove the severe gaurdrail warning.

---

<div class="post-metadata">

**Author:** ![KARTHEE\_P](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/karthee_p/32/1836_2.png) [@KARTHEE\_P](https://forums.pega.com/u/KARTHEE_P)\
**Post date:** [December 27, 2023, 3:47pm UTC](https://forums.pega.com/t/pega-infinity-23-can-call-java-method-and-write-java-code-or-not/5636/3 "2023-12-27T15:47:59Z")

</div>

Hi @SAHARACH,

We can use Java Step in Activity rule in Pega Infinity 23. But it is recommended / Best practice to use Pega OOTB Methods instead of Java Step methods.

Thanks  
Karthee P
