public static void main(String ars)
when i compile above code at [b] windows desktop[/b] and .class file also generates if try to run than i am getting "NoSuchMethodError".
but if i compile above code at location other than windows desktop and copy class file to windows desktop then it executes fine.
code that compiled at other than windows desktop location , if i copy that .class file to windows desktop and use try to run then it works as expected.
but .class generated at windows desktop do not execute at any other location.
please help me on this...
Enviorment varible is set.
i manually set classpath at windows desktop location then also it's not working.
What, exactly, are you typing at the command line to run that class? Something like "java Test" should do the trick no matter in which directory you are.
Since you mention the CLASSPATH variable, I'd advise not to use that. It's generally less troublesome to specify any directories or libraries as part of the command (using the "-cp" switch). Note that all paths needs to be put into double quotes if they contain spaces.
Joined: Nov 23, 2009
Hello, Ulf Dittmer
Its working fine now, but i still not understand why that was happening. even though i set CLASSPATH.