4

I'm trying to build JFX scene builder from openjfx sources but I'm can't find a valid howto or clear documentation, I've already read the official openjfx instruction that are not for scene builder but for the whole sdk, so I've installed mercurial and gradle but i have some question:

1) Can i build only the scene builder without building the whole SDK ?

2) I've tried to run gradle from apps/scenebuilder folder it run successfully but where to find the generated artifact ? I was expecting a target folder with a jar inside but nothing was generated.

3) I've googled around and found that it should be possible to download only the scene builder sources from mercurial but i can't find any valid mercurial repo.

any help will be highly appreciated, many thanks.

2
  • Please only ask a single question per question. If they are very closely related, it's fine, but in this case they're three separate facets of one project. In addition, your third question isn't even a question, just a statement. Commented Mar 25, 2015 at 14:46
  • Sorry, this is my very first post on stack overflow Commented Mar 26, 2015 at 16:00

3 Answers 3

5

Download Scene Builder Source from here:

https://bitbucket.org/gluon-oss/scenebuilder/downloads

In e(fx)clipse create a new JavaFX Project "SceneBuilder".

From the downloaded source copy the com packages (from both subfolders "java" and "resources" to the src folder.

In e(fx)clipse click File -> Export -> Java -> Runnable JAR with com/oracle/javafx/scenebuilder/app/SceneBuilderApp.java as start app and create a runnable jar.

There's nothing else to it.


In case you don't want to get SceneBuilder from gluon, you can get it from here:

http://hg.openjdk.java.net/openjfx/8u40/rt/file/eb264cdc5828/apps/scenebuilder

Same steps apply. Just copy the contents of the src folder of SceneBuilderApp and SceneBuilderKit to a new JavaFX project, let it compile, create a runnable jar and be done with it. It works flawless without problems.

Sign up to request clarification or add additional context in comments.

4 Comments

Thank you very much for the hint, but my problem is understand why it can't build, the scene builder is available also as binary from gluon, i can't rely my job on something i can't understand, so since i've decided to use scene builder and the official distribution is the source code I'll use it only if I can get it build myself.
The mechanism is exactly the same for the "official" version from wherever you may get it. What's the problem?
Simple, I want to build it myself but it can't get it built on my laptop so I want to understand what's wrong, since it's an open source tool it should be possible to build from the original sources.
Nobody here can possibly fathom what's wrong with your laptop. I updated the instructions with the scene builder version from openjfx. It's very easy to build your own. In fact I'm impressed that it's really that easy and works without any problems at all. I'm afraid that if you can't do that, I rather suggest you use the installer from gluon.
3

Ok,

It turned out that there's no need to build the whole SDK from openjfx to build the scene builder app I've solved this way:

1) Installed latest ant from apache official site 2) Gone into the apps/scenebuilder folder 3) Run ant -Dplatforms.JDK_1.8.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/ jar 

This worked for me, the result of the build is in the "dist" folder and to run the just built scene builder i had to use

/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home//bin/java -cp /Users/fabiofrumento/openjfx/apps/scenebuilder/SceneBuilderKit/dist/SceneBuilderKit.jar:/Users/fabiofrumento/openjfx/apps/scenebuilder/SceneBuilderApp/dist/SceneBuilderApp.jar com.oracle.javafx.scenebuilder.app.SceneBuilderApp 

Obviously the paths are to be customized for you installation.

Comments

1

It can be built from the sources using maven.

1) Download the sources: http://hg.openjdk.java.net/openjfx/8u60/rt/

2) Create a maven project & folder:

mvn archetype:generate -DartifactId=SceneBuilder -Dpackage=com.oracle.javafx.scenebuilder.app -DgroupId=com.oracle 

3) Edit the pom.xml file in the newly created directory:

<properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> </properties> <build> <resources> <resource> <directory>src/main/java</directory> <excludes> <exclude>**/*.java</exclude> </excludes> </resource> </resources> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>3.0.2</version> <configuration> <archive> <manifest> <mainClass>com.oracle.javafx.scenebuilder.app.SceneBuilderApp</mainClass> </manifest> </archive> </configuration> </plugin> </plugins> </build> 

4) Extract the sources:

  • SceneBuilderApp/src/com/ and SceneBuilderKit/src/com/ both overwrite SceneBuilder/src/main/java/com/
  • The result should be files in SceneBuilder/src/main/java/com/oracle/javafx/scenebuilder/{app,kit}

5) Build the .jar:

mvn clean package 

6) Run it from the SceneBuilder/target/ directory:

java -jar SceneBuilder<version-string>.jar 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.