Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: LoadError: no such file to load -- jfxrt #13

Closed
edubkendo opened this issue Jan 23, 2013 · 8 comments
Closed

Windows: LoadError: no such file to load -- jfxrt #13

edubkendo opened this issue Jan 23, 2013 · 8 comments

Comments

@edubkendo
Copy link
Member

So after the earlier issue, wanting to test the packaging tools on Windows, and finally getting the jarify command working in spite of my Windows ignorance, I went to run the jar and it wouldn't run. So I tried just running the the source, the samples, they all kept getting the above error, which indicates-- for those who may find this when searching later-- that the jfxrt.jar isn't on the classpath.

I tried all manner of methods to get this working, uninstalling jdk8 and installing jdk7, changing java_home, setting classpath from the command line, trying the java installed in different places "ProgramFiles", "C:", "User/Me", I even used a Maven plugin which is supposed to fix issues with JavaFX, Windows and the classpath, that I'd read about a short while ago.

Still kept getting the below error:

LoadError: no such file to load -- jfxrt
           require at org/jruby/RubyKernel.java:1027
           require at c:/jruby-1.7.2/lib/ruby/shared/rubygems/custom_require.rb:
36
            (root) at c:/jruby-1.7.2/lib/ruby/gems/shared/gems/jrubyfx-0.9-java/
lib/jrubyfx/jfx_imports.rb:27
           require at org/jruby/RubyKernel.java:1027
            (root) at c:/jruby-1.7.2/lib/ruby/shared/rubygems/custom_require.rb:
1
           require at c:/jruby-1.7.2/lib/ruby/shared/rubygems/custom_require.rb:
36
  require_relative at file:/C:/jruby-1.7.2/lib/jruby.jar!/jruby/kernel19/kernel.
rb:19
           require at org/jruby/RubyKernel.java:1027
            (root) at c:/jruby-1.7.2/lib/ruby/gems/shared/gems/jrubyfx-0.9-java/
lib/jrubyfx.rb:21
            (root) at HelloWorldApp.rb:1

Finally, found in jrubyfx / lib / jrubyfx / jfx_imports.rb where it would check for an environmental variable called "JFX_DIR", so once I set that everything began to work as expected so far.

I've VERY possibly missed something simple that would have solved this, but figured it was also likely either no one was using windows or they were using IDE's which were managing this. Sorry so long-winded, wanted to make sure to point out what did not work, though.

@enebo
Copy link
Member

enebo commented Jan 23, 2013

I am not on Windows at the moment, but I am wondering what happens when you type:

jruby -e "require 'java'; puts ENV_JAVA['sun.boot.library.path']"

I think that code in jfx_imports may not be doing something it needs to for the path specified by that Java ENV.

@byteit101
Copy link
Member

If you could post what enebo suggested, that would be awesome. the code in jfx_imports massages that variable and it might be located in a slightly different location and hence would require a slightly different regexp. On linux it has to strip out the architecture, and if you could post what it is on windows that would be awesome.

@edubkendo
Copy link
Member Author

Ok, First time I ran it, got this:

C:\Users\edub>jruby -e "require 'java'; puts ENV_JAVA['sun.boot.library.path']" 
Cannot locate Java installation, specified by JAVA_HOME:

I mentioned, I'd installed and uninstalled jruby and various jdk's a number of times trying to get this working and jruby kept auto-setting the JAVA_HOME variable for me to "C:\Program Files\Java\jre7" So correcting JAVA_HOME to "C:\Program Files\Java\jdk1.7.0_11" I get:

C:\Users\edub>jruby -e "require 'java'; puts ENV_JAVA['sun.boot.library.path']"
C:\Program Files\Java\jdk1.7.0_11\jre\bin

Weirdly (or not) unless I set that JFX_DIR var, it doesn't matter what JAVA_HOME is, I get that same error when running jrubyfx apps.

@byteit101
Copy link
Member

hmm, what do you set JFX_DIR to? and does \jre\bin contain jfxrt.jar? or does \jre ? (basically where is jfxrt.jar)

@edubkendo
Copy link
Member Author

jfxrt.jar is in C:\Program Files\Java\jdk1.7.0_11\jre\lib, which is what I set JFX_DIR to, \jre\bin is a bunch of dll files.

@byteit101
Copy link
Member

hmm, interesting. I'm going to push a fix in a few minutes to give proper warnings and search for the new windows path

@byteit101
Copy link
Member

fix in #14.

@edubkendo
Copy link
Member Author

Looks like your fix works perfectly on my end, so I'm gonna close this .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants