dimanche 17 avril 2016

How to run .class file programmattically in java from another .java file in servlet?

My Question is that I have a .class file(first servlet program after compilation) which is compiled using netbeans(apache tomcat as server) and have another .java file(second servlet program). I delete .java file of my first servlet program and keep its .class file only.Now from second servlet program , I want to execute .class file of first servlet program and also pass some parameters to my .class file(first servlet program after compilation).

May I will be able to overcome this problem?Is this Possible?

I have googled lot on the internet.It shows use reflection or use something like this : Process theProcess = re.exec("java -cp C: /java/abc.class"); . But I am unable to solve this problem.

Please help me.

Thank you for Your concern in advance.





Aucun commentaire:

Enregistrer un commentaire