0

I want to compile a class (for example Test1) in memory and directly store the byte code in a database as a BLOB.

Additionally I also want to compile a new class (Test2) which calls Test1 which is stored in the database. So I need to load this class from the database to compile Test2. Is that even possible, and if yes how could I do that?

I have read about the InMemoryCompiler and the DatabaseClassLoader, but I'm not sure if thats the right thing to work with.

https://github.com/trung/InMemoryJavaCompiler

How can I load java class from database?

If someone just know how to solve the first problem, that would also be great.

Thank you for your answers.

Community
  • 1
  • 1
C.Ompiler
  • 11
  • 1
  • Why? This is a very fragile thing to do. – Elliott Frisch Mar 23 '17 at 23:10
  • And you'd almost certainly use up more memory with this scheme, too. That linked answer pretty much _is_ what you'd have to do, ignoring some minor details. What's the actual problem you're trying to solve, that you see this as the solution? – Clockwork-Muse Mar 24 '17 at 01:16
  • I need to compile a new class, which has reference to other classes which are already stored as.class in a database or the Filesystem. But in the database/filesystem are stored 1000 of classes, so I dont want to load the whole package, I only want to load the .class files I really need. So how can I compile the new Class during runtime, that it knows the external references? – C.Ompiler Mar 24 '17 at 06:04

0 Answers0