require 'java'
java_import 'JavaClass'

# The following won't work
#class JRubyExtClass < JavaClass
#  def initialize(value)
#  end
#end
#
#puts JRubyExtClass.new(1)

class JRubyExtClass < JavaClass
  attr_accessor :value
  
  def self.create_new(value)
    instance = new()
    instance.instance_eval { @value = value }
    instance
  end

  private_class_method :new  
end

inst = JRubyExtClass.create_new(1)
puts inst.value