Results 1 to 7 of 7
  1. #1
    anthropamorphic's Avatar
    anthropamorphic is offline Senior Member
    Join Date
    Jun 2011
    Posts
    135
    Rep Power
    0

    Default (Help) Run Java Programs With A Java Program?

    Hello, I have been wanting to build a program that could run other peoples programs. What I mean is I would build a custom gui that could run things like terminal/console could.

    Example:
    if someone made a program like this
    System.out.println("hello");
    it would be able to run that and display it as the label.

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default

    BeanShell is a mature and full featured interpreter for Java.

  3. #3
    anthropamorphic's Avatar
    anthropamorphic is offline Senior Member
    Join Date
    Jun 2011
    Posts
    135
    Rep Power
    0

    Default

    Quote Originally Posted by pbrockway2 View Post
    BeanShell is a mature and full featured interpreter for Java.
    Wait what?

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,798
    Rep Power
    19

    Default

    What pbrockway said.
    BeanShell will take text and interpret it as Java code.
    You should (I've not tried, but I'd be surprised if you couldn't) be able to hook into the output from it, so should be able to get the "Hello World" output from your System.println("Hello World") line.

  5. #5
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default

    There is a java package: import javax.tools.JavaCompiler.*;
    that might be of interest.

  6. #6
    anthropamorphic's Avatar
    anthropamorphic is offline Senior Member
    Join Date
    Jun 2011
    Posts
    135
    Rep Power
    0

    Default

    Oh ok well I wonder if you could just hook into the output of a terminal or console

  7. #7
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default

    Look at the Process and Runtime classes. They have methods to get the console output

Similar Threads

  1. 2 Java Programs Interacting Same Computer
    By ForeverP in forum Advanced Java
    Replies: 6
    Last Post: 06-20-2011, 11:21 AM
  2. Websites for java programs?
    By Phoenix Dogstar in forum Forum Lobby
    Replies: 1
    Last Post: 05-03-2011, 05:11 AM
  3. How to make 11 java programs into one.
    By decgaid06 in forum New To Java
    Replies: 6
    Last Post: 03-29-2011, 06:23 PM
  4. Replies: 8
    Last Post: 09-30-2010, 06:32 PM
  5. Putting Java Programs on a DVD
    By matt.monkeyboy in forum Advanced Java
    Replies: 4
    Last Post: 04-05-2010, 03:06 AM

Tags for this Thread

Posting Permissions

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