# Easier way to invoke a jarfile?

**URL:** <https://discourse.flox.dev/t/easier-way-to-invoke-a-jarfile/1135>\
**Category:** Help\
**Created:** [June 4, 2025, 10:48am UTC](https://discourse.flox.dev/t/easier-way-to-invoke-a-jarfile/1135 "2025-06-04T10:48:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogererens](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/rogererens/32/768_2.png) [@rogererens](https://discourse.flox.dev/u/rogererens)\
**Post date:** [June 4, 2025, 10:48am UTC](https://discourse.flox.dev/t/easier-way-to-invoke-a-jarfile/1135/1 "2025-06-04T10:48:15Z")

</div>

Hi all,  
I used `flox install tika` to obtain the Apache Tika toolkit and activated this in my tika environment.  
Now I’d like to use the command line version of the toolkit using `java -jar tika-app.jar` and eventually found the path to the jarfile:  
`/nix/store/bvx8sqd4cv319ys9mas59flgznm75jqp-tika-2.9.3/share/tika/tika-app.jar`

Is there an easier way to invoke that jarfile from the command line? Like, having `flox install` to add that `/share/tika` directory to $PATH?

---

<div class="post-metadata">

**Author:** ![brantley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/brantley/32/602_2.png) [@brantley](https://discourse.flox.dev/u/brantley)\
**Post date:** [June 4, 2025, 2:24pm UTC](https://discourse.flox.dev/t/easier-way-to-invoke-a-jarfile/1135/2 "2025-06-04T14:24:08Z")

</div>

Hi @rogererens,

The canonical way to find that file is by way of the `$FLOX_ENV` variable, like this:

```auto
java -jar $FLOX_ENV/share/tika/tika-app.jar

```

You can also create an alias to invoke that for you like this:

```auto
Michaels-MBP% flox list -c
version = 1

[install]
tika.pkg-path = "tika"
jdk.pkg-path = "jdk"

[profile]
zsh = '''
  alias doit='java -jar $FLOX_ENV/share/tika/tika-app.jar'
'''
Michaels-MBP% flox activate
✅ You are now using the environment 'tika-demo'.
To stop using this environment, type 'exit'

flox [tika-demo] Michaels-MBP% doit
/* ... fires up app ... */

```

In the near future we’ll also have a way to create and share packages that make it easier to share across projects with distinct environments.

Hope this helps!
