Results 1 to 2 of 2
  1. #1
    Rak239 is offline Member
    Join Date
    Nov 2009
    Posts
    1
    Rep Power
    0

    Smile How can i execute one java file(dynamically created) from the other

    Hi,

    I need a solution for the below problem...

    How can i execute one java file(dynamically created) from the other? I am using Eclipse editor for my programming...

    In detail what i am doing is.....

    I have class A which contains the main method. In this file A i have the code to generate the Class B (created during runtime while executing class A). And i want to execute the class B from class A itself?

    I have tried ......Run.getruntime.exec("javac B") and Run.getruntime.exec("java B"). But this doesnot works.

    If reflection concept works in this case please let me know how to use that.


    Anyone please suggest me the solution. If you want more details please let me know i will provide.

    Thanks,
    Rak

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    As of 1.6 you can use the java compiler API to dynamically compile source file.

Similar Threads

  1. Replies: 3
    Last Post: 10-27-2009, 02:19 PM
  2. Problem executing .exe file created with C++ code
    By Singing Boyo in forum Advanced Java
    Replies: 45
    Last Post: 05-30-2009, 12:39 AM
  3. Replies: 2
    Last Post: 03-09-2009, 02:36 AM
  4. [SOLVED] Can variable names be dynamically created?
    By CJSLMAN in forum New To Java
    Replies: 4
    Last Post: 01-03-2009, 01:06 AM
  5. How to find file created date.....
    By roshithmca in forum Advanced Java
    Replies: 1
    Last Post: 02-18-2008, 09:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •