I am trying to compile some java files which uses the object of some other class. For example, i have two directories 'comm' and 'b'. i am trying to compile the java files in directory 'b' which uses the files in 'comm' directory. I " don't " want to import the package of 'comm', but i want the java files in 'b' should get compiled without error. the files in 'b' do not conatain error. but every time i compile it. it gives me some object is missing(which is in 'comm'). how do i do it? please help me with this
It sounds like you are having a problem with your CLASSPATH. Make sure that the parent directory of your "comm" and "b" directories is in the CLASSPATH. For example, if your directory structure looks like this: ... MyProject \--src |--comm |--b then make sure MyProject/src is in your CLASSPATH. This also assumes that your classes are declared in packages, e.g. "package comm;" appears in all of your comm classes and "package b;" appears in all of your b classes.
Blake Minghelli<br />SCWCD<br /> <br />"I'd put a quote here but I'm a non-conformist"
Thank you for the answers. What I have stated down is possible when we give command as javac -classpath \MyProject\src\comm \Myproject\src\b\test.java then does the '-classpath' calls the setclasspath and sets the path to the specified directory. If yes then is previously set path gets reset?
I wish to win the lottery. I wish for a lovely piece of pie. And I wish for a tiny ad:
Gift giving made easy with the permaculture playing cards