Java compiling

OogyWaWa

Senior member
Jan 20, 2009
623
0
71
is there any way to get java to compile a simple .java file into a .class file while ignoring errors? I know it seems silly, but basically here is my situation:
i'm working with a sample project to figure out how a portlet works.
i just want to add one simple task, so i'm making copies of java source file, making just a few name changes (of jsp pages) and i want to compile that.
the problem is, i don't have the full source code or project info for the sample i'm working with. just a bunch of .java files and their file structure.
when i compile, the compiler complains about packages, bla bla bla. well, iknow there aren't any properly linked packages within the project it thinks it is compiling, but, once the .class file is in the right place, it should all work fine...

so, am i trying to do something that is just impossible, and i need to find someway to import a full source code of this sample project...
or can i tell javac to ignore and just turn the thing into a .class

thanks :)
 

degibson

Golden Member
Mar 21, 2008
1,389
0
0
In order to make a classFile (see http://java.sun.com/docs/books...ml/ClassFile.doc.html), the java compiler needs to be able to spit out usable bytecode for the whole file -- that includes the ability to reference all external dependencies. Even if there was a way to 'magically' get javac to make a classFile, those classFiles wouldn't work the way they would in the presence of the full project.