Click here to Skip to main content
15,906,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
what is jcompiler?
in shine enterprise document said there is class in it that compile ur program when ur project is online , it means you can compile at run time

is it possible ?
and how does this class work ?
Posted
Comments
Sandeep Mewara 12-Jul-10 1:51am    
Do you ever Google before posting such questions out here? You post descriptive questions that can be read about online.

1 solution

It's unbelievable! But it's true!!!!!!!!!!!!!!!

You know it's really helpful!
When you are developing a project that is important to you to add some things at run time you can use it! Imagine, you have deployed a project and it is running and your customers are using it! You just want to add some simple thing to it! You have to stop your project, add what you want, recompile it then upload your new compile! As you see it's really expensive! Your customers may loose their work and of course their time! But when you use Jcompiler you can add all things you want without any cost!

It is the best choice to develop ERP projects! So you never need to down your project!

It helps Aspect Oriented Programming (AOP) too! When you use it with reflect, or a ROP framework (Jshooter; the first and the only ROP framework), so you can easily make your project Aspect oriented with no more spaghetti!


To use Jcompiler your class should extends it and then use its methods.
Jcompiler has two methods:

1- addCommandToClassBodyInWindowsRuntime(String class_add,String code)
2- addFileToWindowsRuntime(String class_code)

If you want to add a method to a class that is available in your project you must use the first method.
The first argument is name of the class you want to add method to it , the second one is your code.

For example:

addCommandToClassBodyInWindowsRuntime( "mypackage.Engine" , "public void hello(){System.out.println("hello");}")

And if you need to add a new class to your project which there isn't in it yet, first you should create your class by using second method.
You are being able to add method to this class by using the first method, after creating it; also you can add method at the same time when you are adding class, same as below:

addFileToWindowsRuntime(" public class Engine { public void hello() { System.out.println("hello"); } } " )

And then use the first method to add your method to your project.

In this way you can add classes to your project or even a method or field to one of your classes then use the added values!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900