Comments (4)
@edubkendo You know what the problem is right? c:/blah is being treated as a URL and it is trying to figure out what scheme 'c' is. Whatever is invoking this can fix it by appending: file:/// onto the front of that path and it should fix the issue.
from jrubyfx.
Nope, it's still choking somewhere. So, I made a simple test case.
Two files, hello.rb and launcher.rb (and hello.fxml which we'll get to in a minute)
With launcher.rb like this:
rb = "file:///C:\\Users\\edub\\projects\\jrubyfx\\HelloTest\\src\\hello.rb"
require rb
It returns the error:
LoadError: no such file to load -- file:///C:/Users/edub/projects/jrubyfx/HelloT
est/src/hello
require at org/jruby/RubyKernel.java:1027
require at c:/jruby-1.7.2/lib/ruby/shared/rubygems/custom_require.rb:36
(root) at launcher.rb:2
It seems to be stripping off the .rb
, and then require can't find the file. Now, If I change that to
rb = "C:\\Users\\edub\\projects\\jrubyfx\\HelloTest\\src\\hello.rb"
require rb
or even just:
rb="hello.rb"
require rb
Then it works fine, even if hello.rb is a jrubyfx app, unless hello.rb has a Controller call load_fxml
, something like this:
require 'jrubyfx'
class HelloTestApplication < JRubyFX::Application
def start(stage)
with(stage, title: "HelloTest", width: 600, height: 400)
HelloTestController.load_fxml("hello.fxml", stage)
stage.show()
end
end
class HelloTestController < JRubyFX::Controller
end
HelloTestApplication.launch
Then it breaks, and we get the error from before. Easy enough to avoid for now, since jrubyfx-generator no longer automatically launches the app on Windows, but something to look into?
from jrubyfx.
file:///C:\Users\bla...
means
file://
=> file protocol
/C:\Users\bla...
=> path. note the begining slash. since linux and mac have paths that look like /home/bla
, this is valid for not windows, unless I am missing something or it automatically removes it.
about the fxml stuff, hmm, iteresting. also is this from the gem or master? master has changed the syntax a bit
from jrubyfx.
That's interesting. So, when you mentioned it, I checked, and my copy of master on Windows was a few commits behind. Merging in the recent syntax changes and changing hello.rb to match the new syntax fixes this problem. So, whatever was causing the problem was in the old "load_fxml" I guess, and went away when that did.
A couple of things to mention, jrubyfx-generator looks to have been updated with the new syntax EXCEPT that it still creates the new controller as a subclass of JRubyFX::Controller" but it needs to
include` it instead. I got this error :
TypeError: superclass must be a Class (#<Class:JRubyFX::Controller> given)
until I peeked at Demo.rb and figured out the difference, looks like that is a module instead of a class now?
Just pushed changes to my branch that fix it, and went ahead and removed the check for Windows, since the root of the problem (whatever was in 'load_fxml' that caused this error on Windows) is fixed now due to the syntax changes.
Also, the GettingStarted guide has all the old syntax in it, as it was the first place I looked a minute ago to try to see what needed changing. Is the syntax likely to continue changing quite a lot, or can that be updated? Anyways, going to close this issue, since load_fxml
is gone, and will make PR with fix for generator.
from jrubyfx.
Related Issues (20)
- jrubyfx sensitive to number of spaces in fxml HOT 2
- Enhancement: Provide Ruby binding impls HOT 1
- Setting TableView items doesn't seem to work HOT 4
- Jar classpath issue on windows HOT 1
- jarify with fxml: no .jrubyfx_cache in the jarfile HOT 1
- jarify with fxml: cannot access the fxml files
- jarify with fxml: require_relative doesn't work from inside a jarfile
- jrubfx-jarify compiled jar does not laucnch HOT 5
- cannot run the hello world app HOT 2
- gem install jrubyfx gem not found HOT 1
- Permission denied for 'jrubyfx_cache' HOT 2
- Need more documentation for controller functions HOT 1
- jrubyfx não encaminhando HOT 2
- Is this project active ? HOT 3
- Path to jfxrt.jar loading issue with 1.8.0_202-ea-b03 HOT 1
- Would it be possible to add a screenshot-example to the main README here? HOT 1
- Use javafx 17 modules HOT 3
- Warning: SCENE3D? HOT 1
- More examples perhaps? TextArea specifically
- Classic OOP style? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jrubyfx.