JRuby 1.7 released the first preview version to fix 259 bugs

Source: Internet
Author: User

The JRuby community released JRuby 1.7's first preview version today.

 

JRuby is a pure Java implementation of the Ruby programming language. It integrates Ruby's concise syntax and rich Java class libraries. Through JRuby, you can directly run the Ruby program on the JVM and call the Java class library.

Main improvements to JRuby 1.7 include:

  • Ruby 1.9.3 is now the default runtime Mode
  • Fixed a lot of issues about Ruby 1.9.x compatibility.
  • Supports new bytecode introduced by invokedynamicJava 7 in Java 7. With invokedynamic, you can remove parameters, insert new parameters, process existing parameters and return values, and capture exceptions)
  • Improve performance and concurrency
  • Gradually remove support for Java 5
  • Upgrade RubyGems to 1.8.24
  • Rake upgrade to 0.9.2.2
  • Fixed 259 bugs

JRuby is an interpreter for Ruby and based on Java Virtual Machine (JVM). It combines the simplicity of the Ruby language with the powerful JVM execution mechanism, including full integration with the Java library. Rails accelerates and simplifies the development of Web applications, but it makes people feel immature, especially in terms of high-end enterprise-level functions. On the other hand, the speed, stability, and functions of the Java platform and its virtual machines, libraries, and application servers have been improved. It is now recognized as a leading platform for developing high-end server applications. However, if the Java platform is not associated with emerging languages such as Ruby, it may fall behind the popular trend.

Sample Code:

 
 
  1. require "java" 
  2.  
  3. include_class "java.util.TreeSet" 
  4. include_class "com.example.CallMe" 
  5. include_class "com.example.ISpeaker" 
  6.  
  7. puts "Hello from ruby" 
  8. set = TreeSet.new 
  9. set.add "foo" 
  10.  
  11. set.add "Bar" 
  12. set.add "baz" 
  13. set.each { |v| puts "value: #{v}" }  
  14.  
  15. cm = CallMe.new 
  16. cm.hello  
  17. $globalCM.hello  
  18.  
  19. class CallJava  
  20.   include ISpeaker  
  21.   def initialize  
  22.     super 
  23.     @count = 0 
  24.   end  
  25.  
  26.   def say(msg)  
  27.     puts "Ruby saying #{msg}" 
  28.   end  
  29.     
  30.   def addOne(from)  
  31. #    m.synchronize {  
  32.       @count += 1 
  33.       puts "Now got #@count from #{from}" 
  34.  
  35. #    }  
  36.   end  
  37. end 

Http://www.jruby.org/2012/05/21/jruby-1-7-0-preview1.html details

Home: http://www.jruby.org/

Download: http://www.jruby.org/download

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.