Blocking Issue with JDK Java 8 (build 1.8.0_20-ea-b05) #82

Closed
ad-github opened this Issue Mar 21, 2014 · 10 comments

Projects

None yet

5 participants

@ad-github

Hello,

With the official Java 8 release, I try today to setup jRubyFX, and to run the samples.
#1) My configuration:

a) OS: CentOS 6.5 64 bit (2.6.32-431.5.1.el6.x86_64)
b) last java8 available (64 bit):

$ java -version
java version "1.8.0_20-ea"
Java(TM) SE Runtime Environment (build 1.8.0_20-ea-b05)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b05, mixed mode)

c) jruby (last available):

$ jruby -v
jruby 1.7.11 (1.9.3p392) 2014-02-24 86339bb on Java HotSpot(TM) 64-Bit Server VM 1.8.0_20-ea-b05 +indy [linux-amd64]

#2) installation:

gem install jrubyfx

Fetching: jrubyfx-fxmlloader-0.3-java.gem (100%)
Successfully installed jrubyfx-fxmlloader-0.3-java
Fetching: jrubyfx-1.1.0-java.gem (100%)
Successfully installed jrubyfx-1.1.0-java
2 gems installed

==> sounds good for the moment...

I dowload the zip (jrubyfx-master.zip), and try to to run the samples:

jruby -I lib samples/test_all_the_samples.rb
'''================================================================================
 /work/development/jRubyFxDEV/jrubyfx-master/samples/fxml/Demo.rb
'''================================================================================
Please run `rake reflect` to generate the imports
...
'''================================================================================
Please run `rake reflect` to generate the imports
'''================================================================================
Errno::ENOENT: No such file or directory - No such directory: contrib/collections_demo.rb
  initialize at org/jruby/RubyDir.java:149
     foreach at org/jruby/RubyDir.java:432
      (root) at samples/test_all_the_samples.rb:37
     foreach at org/jruby/RubyDir.java:432
      (root) at samples/test_all_the_samples.rb:36
       chdir at org/jruby/RubyDir.java:370
      (root) at samples/test_all_the_samples.rb:30

==> So I launch the following command:

rake reflect
touch lib/jrubyfx/core_ext/precompiled.rb
touch lib/jrubyfx/dsl_map.rb
touch lib/jrubyfx/imports.rb
JavaFX runtime not found.  Please install Java 7u6 or newer or set environment variable JFX_DIR to the folder that contains jfxrt.jar 
If you have Java 7u6 or later, this is a bug. Please report to the issue tracker on github. Include your OS version, 32/64bit, and architecture (x86, ARM, PPC, etc)

==> The message is clear, I have Java8, so I don't have to setup the JFX_DIR
#3) Additional steps:

Forcing the JFX_DIR ('jfxrt.jar' is prsent)

export JFX_DIR=${JAVA_HOME}/jre/lib/ext

==> re-launch the "rake reflect", and new messages.

rake reflect
touch lib/jrubyfx/core_ext/precompiled.rb
touch lib/jrubyfx/dsl_map.rb
touch lib/jrubyfx/imports.rb
rake aborted!
cannot initialize Java class javafx.stage.Screen
org/jruby/javasupport/JavaClass.java:1250:in `for_name'
org/jruby/javasupport/JavaUtilities.java:34:in `get_proxy_class'
file:/work/development/bin_tools/jruby-1.7.11/lib/jruby.jar!/jruby/java/core_ext/object.rb:26:in `java_import'
org/jruby/RubyArray.java:2409:in `map'
file:/work/development/bin_tools/jruby-1.7.11/lib/jruby.jar!/jruby/java/core_ext/object.rb:22:in `java_import'
/work/development/jRubyFxDEV/jrubyfx-master/Rakefile:119:in `(root)'
org/jruby/RubyArray.java:2409:in `map'
/work/development/jRubyFxDEV/jrubyfx-master/Rakefile:115:in `(root)'
org/jruby/RubyIO.java:1182:in `open'
/work/development/jRubyFxDEV/jrubyfx-master/Rakefile:79:in `(root)'
org/jruby/RubyProc.java:271:in `call'
org/jruby/RubyArray.java:1613:in `each'
org/jruby/RubyArray.java:1613:in `each'
org/jruby/RubyKernel.java:1101:in `load'
Tasks: TOP => reflect
(See full trace by running task with --trace)

#4) Another try: With Java 7u40

$ java -version
java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)

When I change the JDK to java7, I have to perform a "rake reflect" to regenerate some files, but I can launch the samples.
(jruby -I lib samples/test_all_the_samples.rb)

After that, when I tried to launch again the samples with a java8, some demos work, but not all...

Hope this help!

Regards,
AD

@byteit101
Member

Again? hmm, the regex must be bad then... that looks like a beta, not a release and as such its probably not triggering java8 behavior

@ad-github

Hello,

Yes you are right (it's an EAR) and ... not (official Java8 have problems with jRubyFX).

Yes the "8u20 Build b05" is an "JDK 8 Early Access Releases" which can be found there:
https://jdk8.java.net/download.html

It's where I had habit to have a look of the progression of Java 8.

But for some days now, the Java 8 is officially released:

http://www.oracle.com/technetwork/java/javase/overview/index.html
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

I dowload it, and redo the installation of jRubyFX from the beginning.

java -version
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)

The build 132 was the previous early release!

jruby -v
jruby 1.7.11 (1.9.3p392) 2014-02-24 86339bb on Java HotSpot(TM) 64-Bit Server VM 1.8.0-b132 +indy [linux-amd64]

I have error at the first Demo:

jruby samples/fxml/Demo.rb
NameError: cannot initialize Java class javafx.scene.control.Pagination
(root) at /work/development/bin_tools/jruby-1.7.11/lib/ruby/gems/shared/gems/jrubyfx-1.1.0-java/lib/jrubyfx/core_ext/pagination.rb:20
require at org/jruby/RubyKernel.java:1085
(root) at /work/development/bin_tools/jruby-1.7.11/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1
require at /work/development/bin_tools/jruby-1.7.11/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55
glob at org/jruby/RubyDir.java:233
load_dsl at /work/development/bin_tools/jruby-1.7.11/lib/ruby/gems/shared/gems/jrubyfx-1.1.0-java/lib/jrubyfx/dsl.rb:313
load_dsl at /work/development/bin_tools/jruby-1.7.11/lib/ruby/gems/shared/gems/jrubyfx-1.1.0-java/lib/jrubyfx/dsl.rb:312
require at org/jruby/RubyKernel.java:1085
(root) at /work/development/bin_tools/jruby-1.7.11/lib/ruby/gems/shared/gems/jrubyfx-1.1.0-java/lib/jrubyfx.rb:37
(root) at samples/fxml/Demo.rb:19

And when I launched the samples, of course, I have an error at the first one (it the same as before).
jruby -I lib samples/test_all_the_samples.rb

But the next ones are working until the following where the process holds with no messages:
/work/development/jRubyFxDEV/jrubyfx-master/samples/contrib/binding_examples/low_level_binding_demo.rb

I have to do a ctrl+C to quit.

As the java8 is officialy released, I think that jRubyFX (or the samples) are not working properly together!

@ad-github ad-github closed this Mar 24, 2014
@ad-github ad-github reopened this Mar 24, 2014
@kojilin
kojilin commented Apr 26, 2014

I have the same problem too.
And JRubyFX::DSL.load_dsl should not run in jrubyfx.rb, some class need to initialize in fx application thread, like javafx.stage.Screen has static initializer and that will throw exception.

@lopsided98

I am running into the same problem as ad-github with Oracle Java 8u5 on Ubuntu 14.04 with an app that uses jrubyfx.

This is the error:

NameError: cannot initialize Java class javafx.scene.control.Pagination
(root) at file:/[...]/SmartDashboardFX/sfx.jar!/jrubyfx/core_ext/pagination.rb:20
require at org/jruby/RubyKernel.java:1084
(root) at file:/[...]/SmartDashboardFX/sfx.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1
require at file:/[...]/SmartDashboardFX/sfx.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55
glob at org/jruby/RubyDir.java:339
load_dsl at file:/[...]/SmartDashboardFX/sfx.jar!/jrubyfx/dsl.rb:313
load_dsl at file:/[...]/SmartDashboardFX/sfx.jar!/jrubyfx/dsl.rb:312
require at org/jruby/RubyKernel.java:1084
(root) at file:/[...]/SmartDashboardFX/sfx.jar!/jrubyfx.rb:37
(root) at classpath:jar-bootstrap.rb:14

@byteit101
Member

@enebo I know you fixed this for java 8 previously, did java 8 change or did it not actually fix it?

@byteit101
Member

This also requires some changes to FXMLLoader as some of the com.sun classes changed:

NameError: cannot load Java class com.sun.javafx.fxml.ObservableListChangeEvent
           (root) at /FXMLLoader/lib/jrubyfx-fxmlloader.rb:39
@byteit101
Member

Should be fixed with latest commits in fxmlloader (c09b9f01cbfee0ea2f6c56fa58b8ed2d6f5016fb) and jrubyfx (85406e7)

@byteit101 byteit101 closed this Aug 6, 2014
@lopsided98

Finally, this is fixed! Thanks!

@tlarevo
tlarevo commented Aug 10, 2014

Sorry, I still get the

NameError: cannot load Java class com.sun.javafx.fxml.ObservableListChangeEvent
          for_name at org/jruby/javasupport/JavaClass.java:1250
   get_proxy_class at org/jruby/javasupport/JavaUtilities.java:34

Error, I've installed jrubyfx, and jrubyfx-fxmlloader from the github source I use
Jruby-1.7.13 and JAVA 1.8.0_20-ea.
What could be the issue ? thanks in advance.

@byteit101
Member

@tlarevo make sure you update fxmlloader to byteit101/JRubyFX-FXMLLoader@c09b9f0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment