How do I compile a .java file without having package data?
I'm trying to compile a .java file into a .class file so I can use it as a 3rd party class that I load during runtime from a开发者_运维技巧 different package/program. I've run into the problem however of having package data and I get a NoClassDefFoundError. Is there a way I can fix this?
So from what I read I got that you want to separately compile a class of yours and and another program and then be able to merge them in some way during runtime. As far as I know that is not possible. You will have to compile this specific .java file alongside the program you are talking about. You will have to make use of the import statement as well in the .java files of the program that are going to use your class.
精彩评论