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
zolfAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gurpsbassiCommented:
speak to your system admin.
This looks related to windows permissions.
0
zolfAuthor Commented:
thanks for your comments.I am the system admin. What do i need to do so ordinary users can run java
0
CEHJCommented:
You need to make sure the Java runtime is in PATH. Since you have a JDK installed, i suggest you set a JAVA_HOME variable to the installation directory of the JDK. PATH would then be edited as follows:

%JAVA_HOME%\bin;<whatever was there before>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The Lifecycle Approach to Managing Security Policy

Managing application connectivity and security policies can be achieved more effectively when following a framework that automates repeatable processes and ensures that the right activities are performed in the right order.

zolfAuthor Commented:
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
0
CEHJCommented:
Yes, but if you have a 64 bit system, you'd be better off with 64 bit java
0
zolfAuthor Commented:
Is that the reason why ordinary users cannot run java
0
CEHJCommented:
Probably. If you

echo %PATH%

Open in new window


as admin and then as other, you will see the differences.
0
zolfAuthor Commented:
But, why admin can run java but not ordinary users
0
CEHJCommented:
Did you just do what i suggested?
0
zolfAuthor Commented:
To install 64 bit java??
0
CEHJCommented:
No. Did you run the command in the ways i suggested?
0
zolfAuthor Commented:
You mean in the PATH variable i enter yhe JAVA_HOME first, i.e. before anything else
0
krakatoaCommented:
So do you have C:\Program Files\Java on your machine (as well as the x86) ?

If so, try adding that to your path.
0
zolfAuthor Commented:
So do you have C:\Program Files\Java on your machine (as well as the x86) ?
No I just have Java on x86
0
krakatoaCommented:
I echoed the path command as admin and as ordinary user and saw no difference in the screen output.
0
zolfAuthor Commented:
I echoed the path command as admin and as ordinary user and saw no difference in the screen output.

Yes I agree!!
0
krakatoaCommented:
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.
0
CEHJCommented:
You need to start a new instance of cmd.exe after altering environment variables
0
krakatoaCommented:
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.
0
CEHJCommented:
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/
0
krakatoaCommented:
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 . . .
0
mccarlIT Business Systems Analyst / Software DeveloperCommented:
@zolf,

My JAVA_Home is set to c:\program files(86)\Java

Can you just check that that is correct? ie. do you have a "bin" folder directly in the above folder? Also, it may just have been a typo but that above path should have been...    C:\Program Files (x86)\Java

Usually Java installs into a further directory under that with a name depending on the version installed, to make the JAVA_HOME variable needing to look something like this...

C:\Program Files (x86)\Java\jdk1.7.0_45

With different numbers depending on the version you have.

And then the PATH set the same as before, ie. %JAVA_HOME%\Bin


Note that you can test whether your issue is PATH related or not by just "cd" to the correct Java Bin directory as the ordinary user and then type:    java.exe        If it works, then your problem is just PATH related, if not then there is something else going on.
0
zolfAuthor Commented:
thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.