How do I run a jar file?

Status
Not open for further replies.

TwittyFlash

Dabbler
Joined
Mar 23, 2016
Messages
20
Hi folks,

I managed to run and install the latest jre into freenas, by running it into my mounted shared drive main folder /mnt/freenas folder . After which I tried running a simple java jar file in the same place.
Only to get a response:

"java:Command not found"

Does freenas allow the running of a jar file in the first place? Was there any mistake in my steps?

Appreciate any kind advice. Thanks.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Was there any mistake in my steps?
If your steps included installing Java (or anything, really) on top of the FreeNAS system itself, yes, there was. Additional software should be installed only in a jail.
 

Linkman

Patron
Joined
Feb 19, 2015
Messages
219
Also make sure that the bin directory of the JRE install is in your $PATH
 

TwittyFlash

Dabbler
Joined
Mar 23, 2016
Messages
20
Any reason why this is the case? I would like the java based application to run on FreeNAS itself.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
freenas is a appliance and with an appliance you don't modify the base installation. If you want to add your own custom applications you do that in a jail.
 

TwittyFlash

Dabbler
Joined
Mar 23, 2016
Messages
20
In that case, that mean I have install the Java into the Jail,which is like a partition of its own.

Isn't Java normaly installed into the usr/local folder instead? Similar to installing into the C drive of a Windows based system.

I woud like to develop programs that is able to read the status of my hardware components. Will the java based program running in jail be able to read these status?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Jails should be able to give you the information you need. Most people would not write a program that monitors hardware in java. You need to use something that is either a scripting language that calls into the system or you use something like C/C++ that has OS sys calls.
 

TwittyFlash

Dabbler
Joined
Mar 23, 2016
Messages
20
Appreciate the prompt reply!
:)I see, so suppose I use a scripting language like C/C++, and run it in the jail, it shall perform as well as though I am running on the OS itself.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Scripting language like Python OR a system language like c/c++
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
Status
Not open for further replies.
Top