Thanks Buck.
I finally figured it out. I needed a space between Program Files and (x86).
Alls good now.

-----Original Message-----
From: JAVA400-L [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Buck Calabro
Sent: Monday, October 20, 2014 10:53 AM
To: java400-l@xxxxxxxxxxxx
Subject: Re: java unrecognized command issues

On 10/20/2014 10:08 AM, Smith, Mike wrote:
I'm having some issues with Java this morning after replacing a win xp
machine with a win 7 machine(64 bit)

The old machine had java jre6 on it. This machine had a .bat file which called another .bat file on a public drive which in turn called 3 java programs. This has been working for years.

The new machine has jre7 on it and when I run the same .bat file I get a 'java not recognized as an internal or external command'.
In researching I keep seeing that I should update the environment path to point to the java directory. I have done this but without success. The old machine did not have this set up.

I do believe it is simply a path issue, but I'm not sure how to fix it.

First. On the old machine I can go to command prompt and type 'Java -version' this works.
On the new machine, I get the 'java not recognized.... ' error.

It does sound like a PATH issue. On my Windows 7 32 bit machine, I have the environment variable JAVA_HOME set to C:\Program Files\Java\jdk1.7.0. On my environment's PATH setting, I have PATH %JAVA_HOME%\bin;c:\other_directories_in_path

To see how your environment is configured, open a command window and either use the echo command (echo %PATH% and echo %JAVA_HOME%) or use the set command to see all the environment variables.

I would advise setting the path and Java Home as system environment variables, not as user variables. That way all processes on the PC will use the same Java that you do in a command window.

--
--buck

'I had nothing to offer anybody except my own confusion' - Jack Kerouac
--
This is the Java Programming on and around the IBM i (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l.


NOTICE: This message, including any attachment, is intended as a confidential and privileged communication. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2021 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.