Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » JAR file will not run from Command Line(Eclipse works but cannot run jar file)
JAR file will not run from Command Line [message #947118] Tue, 16 October 2012 20:51 Go to next message
Michael Mossman is currently offline Michael MossmanFriend
Messages: 5
Registered: October 2012
Junior Member
I have been following the tutorial "Java and Eclipse for Total Beginners".

Everything went fine until the last moment. I created and tested all the Objects and Methods successfully. I created a Main Method and that worked inside Eclipse.

Then I tried to run the .jar file from the Command Line (using Windows 7 ) and got the following error message :-

'java' is not recognized as an internal or external command, operable program or btach file.

No doubt, I have forgotten to set up something important. Can somebody please put me on the right track.

Thanks, Mike
Re: JAR file will not run from Command Line [message #947391 is a reply to message #947118] Wed, 17 October 2012 03:41 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Mike,

It just sounds like java.exe isn't on your path. Find where it is
installed and specify its absolute path.


On 16/10/2012 10:51 PM, Michael Mossman wrote:
> I have been following the tutorial "Java and Eclipse for Total
> Beginners".
>
> Everything went fine until the last moment. I created and tested all
> the Objects and Methods successfully. I created a Main Method and that
> worked inside Eclipse.
>
> Then I tried to run the .jar file from the Command Line (using Windows
> 7 ) and got the following error message :-
>
> 'java' is not recognized as an internal or external command, operable
> program or btach file.
>
> No doubt, I have forgotten to set up something important. Can somebody
> please put me on the right track.
>
> Thanks, Mike
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: JAR file will not run from Command Line [message #948744 is a reply to message #947391] Thu, 18 October 2012 10:26 Go to previous messageGo to next message
Michael Mossman is currently offline Michael MossmanFriend
Messages: 5
Registered: October 2012
Junior Member
Thank you, Ed.

I've now include java in my PATH and all works fine OK.

Just a small gripe though : you would have thought that either Eclipse or JDK would have done this on installation. Everything is pretty well automatic and setting a PATH isn't exactly obvious.
Re: JAR file will not run from Command Line [message #948745 is a reply to message #948744] Thu, 18 October 2012 10:28 Go to previous messageGo to next message
Michael Mossman is currently offline Michael MossmanFriend
Messages: 5
Registered: October 2012
Junior Member
Correction : I meant to say "Everything ELSE is pretty well automatic"
Re: JAR file will not run from Command Line [message #948809 is a reply to message #948744] Thu, 18 October 2012 11:48 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Michael,

I think you can install many JDKs so it would get confusing for them all
to try to put themselves on the path...

On 18/10/2012 12:26 PM, Michael Mossman wrote:
> Thank you, Ed.
>
> I've now include java in my PATH and all works fine OK.
>
> Just a small gripe though : you would have thought that either Eclipse
> or JDK would have done this on installation. Everything is pretty well
> automatic and setting a PATH isn't exactly obvious.
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Guide me on network path in new file () eclipse android
Next Topic:Android project in eclipse juno
Goto Forum:
  


Current Time: Fri Apr 19 00:50:29 GMT 2024

Powered by FUDForum. Page generated in 0.02827 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top