• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting javac not recognized error  RSS feed

 
Nathan Johari
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • 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: 4
  • Mark post as helpful
  • send pies
  • 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.
 
Campbell Ritchie
Marshal
Posts: 56584
172
  • Mark post as helpful
  • send pies
  • 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%
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!