Is it possible to compile a java file without providing its dependencies?

No. But you could provide stubbed-out versions of the dependency class files, if it is only a handful of classes that the code your are trying to compile uses directly.

Then in theory if you take the .class file that compiles and place the real dependencies on the classpath with it your app will work using the correct (non-stubbed-out) dependency classes.


No. Sorry. You'll need all dependncies in the classpath to compile.


You could go crazy and hand craft the required dependencies as stubs that do nothing except keep the compiler happy.


Before any file is compiled it always looks up for any dependencies. but you said you dont have those jars!!!

see if you can remove the dependencies relation for that project/file and then try to compile it. give it a try!