Can you post the code as well?
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
So let me get this straight. Are you having problems with compilation and execution i.e setting it to the correct directory,or problems with the actual program (syntaxing 'n' stuff)?
:sad:
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
i get
Exception in thread "main" java.lang.NoClassDefFoundError: myprogram
Thanks again.
Did you save the file as myprogram.java ? Could be your classpath is not correctly set.
server_crash
Postaholic
2,111 posts since Jun 2004
Reputation Points: 113
Solved Threads: 20
probably a classic case of not adding the current directory to the classpath.
"java -cp . myprogram" should do the trick until you learn to use proper naming conventions for your classes and members.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
by default when u install jdk, the execution path is set to jdk1.5.../bin
.try compiling and executing your java programs in that particular directory.
this should definitely work.good luck.
indianscorpion2
Junior Poster in Training
82 posts since May 2005
Reputation Points: 9
Solved Threads: 1
bad idea. What you're saying is "don't learn to use your tools, here's a quick hack for the terminally lazy and stupid".
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
bad idea. What you're saying is "don't learn to use your tools, here's a quick hack for the terminally lazy and stupid".
I know that my idea is a little obvious.but paul here is just a beginner and he is just concerned with compiling his first java program for god's sake.so I just gave him a simple advice to use the default directory.
indianscorpion2
Junior Poster in Training
82 posts since May 2005
Reputation Points: 9
Solved Threads: 1
by default when u install jdk, the execution path is set to jdk1.5.../bin
.try compiling and executing your java programs in that particular directory.
this should definitely work.good luck.
I must admit from a nubee's point of view that would appear the most intuitive way to get your programs working. I did exactly same when I was trying to jar up my work.
However, it only has a short term benefit. Eventually, he will need to learn how to do it properly. Since this is obviously a strong reason, showing him the proper way to configure his paths may prove more beneficial. Tee he he.
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439