# Importing Java Libraries and accessing Java Classes from script console

**URL:** <https://forum.inductiveautomation.com/t/importing-java-libraries-and-accessing-java-classes-from-script-console/63047>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [August 16, 2022, 2:46pm UTC](https://forum.inductiveautomation.com/t/importing-java-libraries-and-accessing-java-classes-from-script-console/63047 "2022-08-16T14:46:33Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 24, 2022, 12:45pm UTC](https://forum.inductiveautomation.com/t/importing-java-libraries-and-accessing-java-classes-from-script-console/63047/8 "2022-08-24T12:45:32Z")

</div>

See this topic:

> [@ScriptContext through client scope does not return project, but does in Perspective](https://forum.inductiveautomation.com/t/scriptcontext-through-client-scope-does-not-return-project-but-does-in-perspective/62604):
>
> I am using com.inductiveautomation.ignition.common.script.ScriptContext#defaultProject() to get the project from the client calling a script, so that I can make sure I read the resource out of the right project. What I am running into is that if I run this in the Gateway scope (A Perspective Button) this seems to work fine. However when I try this out of the client scope (Script console) I am getting a null in response? I am following the recommendation from [this forum post](https://forum.inductiveautomation.com/t/executing-a-custom-script-as-a-gateway-script-with-hidden-parameters/50315/4), however potentiall…

Especially note the comment about the lameness of the script module example for this case.

---

_[View the full topic](https://forum.inductiveautomation.com/t/importing-java-libraries-and-accessing-java-classes-from-script-console/63047)._
