Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Add Intrepreter to application?

  1. #1
    Junior Member
    Join Date
    Oct 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Add Intrepreter to application?

    Hi all. I was wondering if this is possible in Java. If i have a Client Java application, can I have a "mini" compiler in the application that can read JAVA code runtime (compile it?) and perform the actions in the code based on classes already defined in the application i am compiling this code in?

    This would be neat to add code during the life of the application. Thanks for any help in advance.


  2. #2
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Location
    Madgaon, Goa, India
    Posts
    495
    Thanks
    8
    Thanked 48 Times in 46 Posts

    Default Re: Add Intrepreter to application?

    Take a look at the javax.tools package. Be aware that for compilation to succeed, it is required that a JDK be installed. Just a JRE won't do.

    Then you'll probably need a custom ClassLoader and the Reflection API to load the compiled classes. It doesn't take long for all of that to become very messy.

    This would be neat to add code during the life of the application.
    Not really.

    db

Similar Threads

  1. [SOLVED] How to write to an application
    By straw in forum Java Theory & Questions
    Replies: 4
    Last Post: June 19th, 2010, 10:17 AM
  2. [SOLVED] [help] the application file (.jad) for application does not appear to be the ....
    By ordinarypeople in forum Java ME (Mobile Edition)
    Replies: 0
    Last Post: April 4th, 2010, 03:50 AM
  3. Replies: 0
    Last Post: December 3rd, 2009, 03:43 PM
  4. Help with Java Application
    By Riston in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: November 19th, 2009, 06:17 PM
  5. RMI over SSL Client application
    By boilerchicken in forum Java Networking
    Replies: 0
    Last Post: November 10th, 2009, 06:52 AM