• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting javac not recognized error

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've kept writing this: %JAVA_HOME%\java -fullversion but gets this error: 'C:\Program' is not recognized as an internal or external command, operable program or batch file. And when I run javac or javac.exe, I get error also. I'd appreciate your assistance please. Thanks

Refards,
Nathan Johari
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

This is *not* a Java issue. It is a Windows issue.... and it is related to how variables are expanded.  In this case, the JAVA_HOME variable contains a space, which is interpreted as separate tokens.

It may be better to fix this by using the PATH environment variable, but ... related to this topic/question, you can try to use quotes like so...

C:\> "%JAVA_HOME%"\java -fullversion

Henry
 
Nathan Johari
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much Henry. I so appreciate your contribution with that.

Well, suddenly, after compiling my program and try to run it, using 'jave Fulename' it gives continuous error message saying, "Error: could not find or load main class Filename."

Can you help with this please?

Thanks..

Nathan.
 
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What happens when you write the dir instruction in that location at the command line? Is the file you are seeking actually in the same location?
Have you set a CLASSPATH environment variable? That usually does more harm than good. What do you get from this? echo %CLASSPATH%
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic