Package com.example.assembly

Source Code of com.example.assembly.Main

package com.example.assembly;

import com.example.Hello;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.SimpleBindings;

class Main {

    public static void main(String... args) throws Exception {
  ScriptEngineManager manager = new ScriptEngineManager();
  ScriptEngine engine = manager.getEngineByName("jruby");
  engine.eval("require 'rubygems';");
 
  System.out.println(engine.eval("begin\n" +
      "require 'hello'\n" +
      "Hello.new.world\n" +
      "rescue LoadError\n" +
      "'no ruby hello found'\n" +
      "end"));

  System.out.println(new Hello().world());
    }
}
TOP

Related Classes of com.example.assembly.Main

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.