JRuby can't load FileRef?

Why can’t JRuby load FileRef?

$ java -version
java version “1.7.0-ea”
Java™ SE Runtime Environment (build 1.7.0-ea-b93)

error.rb

require ‘java’

include_class ‘java.io.IOError’
include_class ‘java.nio.file.FileRef’

/jruby-1.5.0/lib/ruby/site_ruby/shared/builtin/javasupport/core_ext/object.rb:99
warning: already initialized constant IOError
/jruby-1.5.0/lib/ruby/site_ruby/shared/builtin/javasupport/core_ext/object.rb:26:in
`include_class’: cannot load Java class java.nio.file.FileRef
(NameError)
from error.rb:4


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi,

FileRef is part of Java 7. Make sure you run JRuby with Java 7 then.
The easiest way is to define JAVA_HOME env. property that points to
right JDK.

Thanks,
–Vladimir

On Thu, May 20, 2010 at 12:56 PM, consiliens [email protected]
wrote:

include_class ‘java.nio.file.FileRef’
http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

NetBeans wasn’t respecting Java Platform set to JDK 7 for Run File on
Ruby files. Running netbeans with an explicit --jdkhome solved the
issue. Thanks.

On 05/20/2010 06:31 AM, Vladimir S. wrote:

Why can’t JRuby load FileRef?


To unsubscribe from this list, please visit:

 http://xircles.codehaus.org/manage_email

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email