Skip to main content

"code too large" error in Preview SDK for scene graph initialization

3 replies [Last post]
ishmal
Offline
Joined: 2007-04-30

Hi, all.

I have written an initial export from Inkscape SVG to a JavaFX class with a CustomNode create() method. This method has a scene graph which somewhat mirrors the SVG tree. My problem is that when the SVG image is of any size, the compiler reports "code too large" on the JavaFX method.

The problem is this: for JavaFX to be true to its design, it -must- allow scene graphs of any size to be described in purely declarative syntax, and there should be no artificial requirement to break them up into smaller pieces to make the compiler happy. I realize, of course, that Java methods have a bytecode limit, but this is JavaFX, not Java.

Would declaring the graph to be a "final" class member help? Or is this just a quirk of being an early preview?

This does not happen in the interpreter.

Thanks. Fun product, by the way!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mbien
Offline
Joined: 2007-04-29

Hi ishmal,

You are hitting probably the JVM per class or method bytecode limit. You could export your content to JavaFX Data (.fxd) instead.

http://java.sun.com/javafx/reference/releasenotes/project-nile-release-n...
(search for "fxd")

ishmal
Offline
Joined: 2007-04-30

Is there no workaround? It would seem like a meta-compiler such as javafxc would be able to avoid the limitations of lower-level Java (like Scala has multiple inheritance). Such a limit would seem to be a result of one-to-one mapping from declarative to deterministic code.

Anyway, I looked at Nile, but I didn't see any specification for the .fxd format. I tried svg-to-fxd conversion, but it exported incorrectly and left out definitions in the area.

To save space, I can use SVGPath instead of individual explicit path segments. However, this still leaves the problem that many things cannot be described declaratively. IMHO, this is something that the compiler needs to overcome.

Joshua Marinacci

This is a limitation of the java class specification (which I *think*
also applies to any bytecode driven language, not just Java). It was
this limitation which caused us to design the FXD format.
Unfortunately, the FXD format is still in flux and does not yet have a
public spec, so I don't advise you to use it. Your best bet right now
is to use the SVG->FXD converter in project Nile. The converter
undoubtedly does have bugs, so please file bug reports on them.

- Josh

On Aug 7, 2008, at 7:45 AM, scenario@javadesktop.org wrote:

> Is there no workaround? It would seem like a meta-compiler such as
> javafxc would be able to avoid the limitations of lower-level Java
> (like Scala has multiple inheritance). Such a limit would seem to
> be a result of one-to-one mapping from declarative to deterministic
> code.
>
> Anyway, I looked at Nile, but I didn't see any specification for
> the .fxd format. I tried svg-to-fxd conversion, but it exported
> incorrectly and left out definitions in the area.
>
> To save space, I can use SVGPath instead of individual explicit path
> segments. However, this still leaves the problem that many things
> cannot be described declaratively. IMHO, this is something that the
> compiler needs to overcome.
> [Message sent by forum member 'ishmal' (ishmal)]
>
> http://forums.java.net/jive/thread.jspa?messageID=292145
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
> For additional commands, e-mail: dev-help@scenegraph.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
For additional commands, e-mail: dev-help@scenegraph.dev.java.net