• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compiling at MS Dos prompt

 
LoryLee Moore
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been trying to compile my java programs at the MS Dos prompt.
I keep getting one of two errors....
"Can't determine application home" and
"Exception in thread "main" java.lang.NoClassDefFoundError: c:\Program"

Can you help me?
Thank you.
LoryLee
 
Darin Niard
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which JDK do you have installed? What exactly are you typing into the prompt?

I think you may need to reinstall the JDK, but I'm not sure.
 
Aj Mathia
Ranch Hand
Posts: 478
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Lorylee
the problem is surely in your classpath or just path
try this in cmd prompt type
set classpath=%classpath%;c:/abc/

where abc is the dir where your compiled java class is located

there is a simpler way to ot and thats something like
set classpath=%classpath%;\.
i am not too sure if it is \. or /. or just . or somthing in this likes
try tese comb and u will get it
or someone else who is sure of this will post a msg
Cheers
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps you had a different version of the jdk installed previously?? According to Roedy Green, you should
"Uninstall all Java JDKs and JREs with the control panel. Use Microsoft's RegClean. Tidy up the registry with regedit. Reinstall just the latest JDK."
 
Aj Mathia
Ranch Hand
Posts: 478
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes i had a quick check it should be set classpath=%classpath%;.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch, LoryLee!

After following Marilyn's advice on reinstalling your Java development and runtime environment, you might still have a problem concerning your CLASSPATH setting. Unless you're regularly using some third party libraries during your development and running of Java applications, I'd suggest that you either don't explicitly specify a CLASSPATH, or set your CLASSPATH to only include the current working directory, specified by a period.

Take a look at our FAQ on setting the CLASSPATH for steps on just that.

If you've further problems and questions, don't hesitate to ask. It'll possibly also be useful for those trying to help you if you were to post the results of what happens when running the following command.

ECHO %CLASSPATH%
 
Ken Okoli
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Lorylee
the problem maybe in your classpath or just path
i guess your compiler does not know where you put your program
1. make sure u save your files in the "bin" directory
i mean for example:
"save as" locate where you installed JDK. Typically, on "C drive" then "jdk1.4.1" then "bin" then "save"
2."start" then "run" then type "sysedit" then add:
set classpath=%classpath%;c:\jdk1.4.1\bin and then save your work.
3. Test by going to dos prompt and typing "path"
you should see your path added......at least that's what i think.
N.B always save your programes with extension ".java"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic