Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 176
  • Last Modified:

Compiler is being dodgey! :o\

Hi..

I'm doing the following at command line:

C:\>cd /d w:\rd
W:\RD>set classpath=%cd%
W:\RD>javac Client.java
W:\RD>java Client

This usually works fine! No problems at all! :)

However, the 'java Client' command won't work, because Client.class don't exist; because, for some strange reason, 'javac Client.java' isn't creating Client.class!! (It isn't creating *any* CLASS file), nor is it spitting out any errors!

This is extremely urgent, please, can you help?

Regards;
0
InteractiveMind
Asked:
InteractiveMind
3 Solutions
 
InteractiveMindAuthor Commented:
I've also specified the output directory, to make sure that for some reason the CLASS file isn't being created elsewhere, like so:

W:\RD>javac %cd%\Client.java -d %cd%
0
 
CEHJCommented:
>>set classpath=%cd%

Is probably invalid

Try

set classpath=

or set classpath=.

after changing directory
0
 
CEHJCommented:
Also the java bin directory must be on the path. To check:

echo %PATH%
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
InteractiveMindAuthor Commented:
Same problem.

If I do:

W:\RD>echo %cd%

it's outputting "W:\RD" which is correct..

Strange. :(

0
 
InteractiveMindAuthor Commented:
Yeah, both the JRE and JDK bins are in the %path% variable
0
 
aozarovCommented:
Does your Client.java contains full code? (If your Client.java doesn't contain a class definition then the compiler will not say anything and will not produce anything).
0
 
InteractiveMindAuthor Commented:
It is a valid class; with a constructor and main method.

Hmm...

I have another directory also: W:\CODE\RD

In there, is also a Client.java file. It will compile fine and also run fine everytime..

It would seem that this may be causing some sort of 'clash'; but, shouldn't this be prevented, if I've specified the CLASSPATH variable to only be the W:\RD directory (temporarily)??
0
 
CEHJCommented:
Personally i would think that using an executable as an environment variable is asking for trouble - but you may get away with it.. I'd be more inclined to do something like:

set CPATH=w:\rd
set CLASSPATH=%CPATH%
cd /d %CPATH%
javac Client.java
java Client
0
 
CEHJCommented:
>>but, shouldn't this be prevented, if I've specified the CLASSPATH variable to only be the W:\RD directory (temporarily)??

Yes
0
 
InteractiveMindAuthor Commented:
Same problem.

lol -- this is sooo strange; it was all fine yesterday!! :o\
It is also working fine in other directories.. just not this one!?!?!?
0
 
InteractiveMindAuthor Commented:
Oh...
I just tried compiling and running a very small, Test program, and it works fine!! :o\

It must be my code...

0
 
CEHJCommented:
Can you post the output of

dir w:\rd\Client.*

?

0
 
InteractiveMindAuthor Commented:
Right.... I just recompiled the Client application.. and now Client.java has been blanked!! :o\
0
 
InteractiveMindAuthor Commented:
lol.. If you want the dir output even though the Client file is blank, then here you go:

 Volume in drive W is Work
 Volume Serial Number is 0545-EDE4

 Directory of W:\RD

13/04/2005  15:49                 0 Client.java
               1 File(s)              0 bytes
               0 Dir(s)  15,641,993,216 bytes free


Do you think that perhaps the file was corrupt?
0
 
CEHJCommented:
Do you have the file open in more than one app?
0
 
CEHJCommented:
... as if you do they might overwrite each other
0
 
InteractiveMindAuthor Commented:
I only have it open in a single IDE;
0
 
CEHJCommented:
Close that IDE after making sure Client.java is valid and try again
0
 
objectsCommented:
> and now Client.java has been blanked

Its certainly not going to create class file if the java file is blank :)
0
 
InteractiveMindAuthor Commented:
lol ;-P

I still have no idea what caused the problem, but I decided to start from scratch, and things are fine now. I will just split the points.

Thanks all.
Regards;
0
 
CEHJCommented:
:-)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now