Link to home
Start Free TrialLog in
Avatar of Zolf
ZolfFlag for United Arab Emirates

asked on

Running Java application as ordinary user

Hello there,

I have a java swing application setup on mswindows 2008R2 and I can run the application as administrator but when ordinary users log into the server and try to run the application they get
'java' is not recognized as an internal or external command, operable program or batch file
.

I added the java bin folder in the systme environment and as adminis when i run type java or javac in cmd it runs as expected but as ordinary user this is also not working. what am i missing.Please help..

cheers
Zolf
Avatar of gurpsbassi
gurpsbassi
Flag of United Kingdom of Great Britain and Northern Ireland image

speak to your system admin.
This looks related to windows permissions.
Avatar of Zolf

ASKER

thanks for your comments.I am the system admin. What do i need to do so ordinary users can run java
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Zolf

ASKER

CEHJ

Thanks for your comments.

My JAVA_Home is set to c:\program files(86)\Java
And then in PATH i have %JAVA_HOME%\bin

Please let me know,if that is what you meant
Yes, but if you have a 64 bit system, you'd be better off with 64 bit java
Avatar of Zolf

ASKER

Is that the reason why ordinary users cannot run java
Probably. If you

echo %PATH%

Open in new window


as admin and then as other, you will see the differences.
Avatar of Zolf

ASKER

But, why admin can run java but not ordinary users
Did you just do what i suggested?
Avatar of Zolf

ASKER

To install 64 bit java??
No. Did you run the command in the ways i suggested?
Avatar of Zolf

ASKER

You mean in the PATH variable i enter yhe JAVA_HOME first, i.e. before anything else
So do you have C:\Program Files\Java on your machine (as well as the x86) ?

If so, try adding that to your path.
Avatar of Zolf

ASKER

So do you have C:\Program Files\Java on your machine (as well as the x86) ?
No I just have Java on x86
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Zolf

ASKER

I echoed the path command as admin and as ordinary user and saw no difference in the screen output.

Yes I agree!!
In the 'old days' you'd have to reboot machines to update the environment. Not sure whether that still holds or not. But the issue is connected with 'path' somehow.
You need to start a new instance of cmd.exe after altering environment variables
You need to start a new instance of cmd.exe after altering environment variables

I did. My sequence was : change environment vars, create new user, open new cmd window, run path, open admin cmd, run path. Results were the same.

Re-reading your question, I can't really say I'm sure about where the program is when you run it, and where it is ('the server') when others run it - maybe that would shed some light on things if it were clarified.
It doesn't really matter whether it's Java or some other app:
http://helpdeskgeek.com/how-to/fix-not-recognized-as-an-internal-or-external-command/
OK, so nothing to do with the above link, but . . . after a reboot (rather than simply a new cmd window), the 'orindary' user on my system has a shorter Path variable returned than the Path var returned from an Admin window.

The missing portion of the Path in the 'ordinary' user window is for Java version 8 . . . making it look at first sight as if only an Admin can reach it without changing straight to the directory itself. That isn't something that sounds right though . . .
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Zolf

ASKER

thanks