build/run javafx code

hello there,

i need to develop/run java apps using javafx ,
javafx is a new software library that allows java developers to write GUI,
i have the following packages installed:

mm6@dhcppc4:~> zypper se -i -s javaLoading repository data...
Reading installed packages...


S | Name                           | Type    | Version         | Arch   | Repository          
--+--------------------------------+---------+-----------------+--------+---------------------
i | java-1_7_0-openjdk             | package | 1.7.0.6-24.13.5 | i586   | openSUSE-13.1-Update
i | java-1_7_0-openjdk-devel       | package | 1.7.0.6-24.13.5 | i586   | openSUSE-13.1-Update
i | java-1_7_0-openjdk-headless    | package | 1.7.0.6-24.13.5 | i586   | openSUSE-13.1-Update
i | libjavascriptcoregtk-1_0-0     | package | 2.2.1-1.1       | i586   | openSUSE-13.1-Oss   
i | libjavascriptcoregtk-3_0-0     | package | 2.2.1-1.1       | i586   | openSUSE-13.1-Oss   
i | timezone-java                  | package | 2013h-1.1       | noarch | (System Packages)   
i | typelib-1_0-JavaScriptCore-3_0 | package | 2.2.1-1.1       | i586   | openSUSE-13.1-Oss   
mm6@dhcppc4:~> 

mm6@dhcppc4:~> java -version
java version "1.7.0_51"
OpenJDK Runtime Environment (IcedTea 2.4.4) (suse-24.13.5-i386)
OpenJDK Client VM (build 24.45-b08, mixed mode)
mm6@dhcppc4:~> 

Do i have to have both openjdk and openjdk-devel in the same time:sarcastic:?

i can’t find javafx pakage in my repos, i’ve the following repos

mm6@dhcppc4:~> zypper lr# | Alias                     | Name                               | Enabled | Refresh
--+---------------------------+------------------------------------+---------+--------
1 | repo-debug                | openSUSE-13.1-Debug                | No      | Yes    
2 | repo-debug-update         | openSUSE-13.1-Update-Debug         | No      | Yes    
3 | repo-debug-update-non-oss | openSUSE-13.1-Update-Debug-Non-Oss | No      | Yes    
4 | repo-non-oss              | openSUSE-13.1-Non-Oss              | Yes     | Yes    
5 | repo-oss                  | openSUSE-13.1-Oss                  | Yes     | Yes    
6 | repo-source               | openSUSE-13.1-Source               | No      | Yes    
7 | repo-update               | openSUSE-13.1-Update               | Yes     | Yes    
8 | repo-update-non-oss       | openSUSE-13.1-Update-Non-Oss       | Yes     | Yes    
mm6@dhcppc4:~> 

i don’t need media codecs so i dont want to have pacman repo

bedo wrote:
>
> hello there,
>
> i need to develop/run java apps using javafx ,
> javafx is a new software library that allows java developers to write
> GUI,
> i have the following packages installed:
>
> Code:
> --------------------
> mm6@dhcppc4:~> zypper se -i -s javaLoading repository data…
> Reading installed packages…
>
>
> S | Name | Type | Version | Arch | Repository
> --±-------------------------------±--------±----------------±-------±--------------------
> i | java-1_7_0-openjdk | package | 1.7.0.6-24.13.5 | i586 | openSUSE-13.1-Update
> i | java-1_7_0-openjdk-devel | package | 1.7.0.6-24.13.5 | i586 | openSUSE-13.1-Update
> i | java-1_7_0-openjdk-headless | package | 1.7.0.6-24.13.5 | i586 | openSUSE-13.1-Update
> i | libjavascriptcoregtk-1_0-0 | package | 2.2.1-1.1 | i586 | openSUSE-13.1-Oss
> i | libjavascriptcoregtk-3_0-0 | package | 2.2.1-1.1 | i586 | openSUSE-13.1-Oss
> i | timezone-java | package | 2013h-1.1 | noarch | (System Packages)
> i | typelib-1_0-JavaScriptCore-3_0 | package | 2.2.1-1.1 | i586 | openSUSE-13.1-Oss
> mm6@dhcppc4:~>
>
> mm6@dhcppc4:~> java -version
> java version “1.7.0_51”
> OpenJDK Runtime Environment (IcedTea 2.4.4) (suse-24.13.5-i386)
> OpenJDK Client VM (build 24.45-b08, mixed mode)
> mm6@dhcppc4:~>
> --------------------
>
>
>
> Do i have to have both openjdk and openjdk-devel in the same
> time:sarcastic:?
>
> i can’t find javafx pakage in my repos, i’ve the following repos
>
> Code:
> --------------------
> mm6@dhcppc4:~> zypper lr# | Alias | Name | Enabled | Refresh
> --±--------------------------±-----------------------------------±--------±-------
> 1 | repo-debug | openSUSE-13.1-Debug | No | Yes
> 2 | repo-debug-update | openSUSE-13.1-Update-Debug | No | Yes
> 3 | repo-debug-update-non-oss | openSUSE-13.1-Update-Debug-Non-Oss | No | Yes
> 4 | repo-non-oss | openSUSE-13.1-Non-Oss | Yes | Yes
> 5 | repo-oss | openSUSE-13.1-Oss | Yes | Yes
> 6 | repo-source | openSUSE-13.1-Source | No | Yes
> 7 | repo-update | openSUSE-13.1-Update | Yes | Yes
> 8 | repo-update-non-oss | openSUSE-13.1-Update-Non-Oss | Yes | Yes
> mm6@dhcppc4:~>
> --------------------
>
>
> i don’t need media codecs so i dont want to have pacman repo
>
>

Here is how i got a sample JavaFx program running.
Note :- I am using a 64 bit OS and hence my instructions would be 64 bit
specific. Provide root password as and when needed

==>Remove openjdk and devel

sudo zypper rm -u openjdk

==>Download jdk from oracle site and install it
The rpm i downloaded was jdk-7u45-linux-x64.rpm. It installed it using
command

sudo zypper in jdk-7u45-linux-x64.rpm

==>Then download and install netbeans. I downloaded
netbeans-7.4-javaee-linux.sh and then installed it using command

sh netbeans-7.4-javaee-linux.sh

==>If you need to run applets on Firefox ,SeaMonkey or Opera then create
a syslink in folder /usr/lib64/browser-plugins using command

sudo ln -s /usr/java/latest/jre/lib/amd64/libnpjp2.so
/usr/lib64/browser-plugins


GNOME 3.10.2
openSUSE 13.1 (Bottle) (x86_64) 64-bit
Kernel Linux 3.11.6-4-desktop

thanks for the oracle java development kit(JDK) installation instruction …
however i don’t think you have to have netbeans to run/build javafx since oracle JavaFX is co-bundled with JDK 7.
http://www.oracle.com/technetwork/java/javafx/downloads/index.html

but if i’m gonna to try OpenJDK,
Do i have to have both openjdk and openjdk-devel in the same time?

building openjfx from the source requires Mercurial and Gradle, i uses git and gnu make.

why wouldn’t OpenSUSE add OpenJDK pakages and include OpenJFX??

It is up to the people which create packages for Linux distributions based upon OpenJDK (e.g. Redhat, Ubuntu etc) to create RPMs for the JDK and JRE that include OpenJFX. Those software distributors, then need to place the generated packages in their standard distribution code repositories (e.g. fedora/red hat network yum repositories). Currently this is not being done, but I would be quite surprised if Java 8 Linux packages did not include OpenJFX when Java 8 is released in March 2014.

Am 16.02.2014 15:06, schrieb bedo:
> but if i’m gonna to try OpenJDK,

I am afraid you have to wait for OpenJDK 8, if you want to use javafx
with it, not 7.


PC: oS 13.1 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.11 | GTX 650 Ti
ThinkPad E320: oS 13.1 x86_64 | i3@2.30GHz | 8GB | KDE 4.11 | HD 3000
HTPC: oS 13.1 x86_64 | Celeron@1.8GHz | 2GB | Gnome 3.10 | HD 2500

however i don’t think you have to have netbeans to run/build javafx
since oracle JavaFX is co-bundled with JDK 7.

I also thought at first that i don’t need Netbeans if i use JDK 7. But
when i tried to run a sample JavaFx program in Eclipse(kepler),it
wouldn’t compile. ie. it could not recognize javafx imports :frowning:
Take a look at the screenshot of the same program in Eclipse and Netbeans

but if i’m gonna to try OpenJDK,
Do i have to have both openjdk and openjdk-devel in the same time?

icedtea-web = Browser plugin
openjdk == JRE
openjdk-devel = JDK

You cannot compile stuff without JDK ! right :wink:

http://img.susepaste.org/view/raw/99540107


GNOME 3.10.2
openSUSE 13.1 (Bottle) (x86_64) 64-bit
Kernel Linux 3.11.6-4-desktop

it works just fine for me…

are you sure that $JAVA_HOME points to the correct JVM run time?
/usr/java/jdk1.7.0_51 or /usr/java/latest

are you sure that you set classpath correctly
${JAVA_HOME}/jre/lib/jfxrt.jar

Hi, could you please be more precise about what is working fine?

I just downloaded java 8 from oracle, which contains JavaFX. JavaFX in java 8 more or less works on openSUSE 13.1 (64 bit). It does, for example, not support audio. The versions of ffmpeg libraries (libavformat and libavcodec) do not match.

So I do not know, whether it would make sence / is necessary, to build openJDK 8 and openJFX on openSUSE 13.1 in order to get audio support with JavaFX.

Or is there another solution, which does not require building anything?

Skimming this rejuvenated thread (a couple posts several months after the thread went dormant),

I can see

  • Yes, it’s highly likely that the posters needed a working JDK (with compiler) to compile new apps. So, they were misled by the idea they could run openJDK which is a misnomer, by default only the JRE of openJDK is installed. An openJDK compiler <can> be built from source, but that’s rarely done because the result is to build Java apps which won’t run in all JRE. You <must> use the Oracle javac from the JDK to build java apps that should run just about anywhere.

  • I do not know of any good guide to installing Oracle SE JDK 8 on openSUSE (any version). There is no official SUSE SDB today that describes how to install Oracle 8, only Oracle 7. You <might> follow the Oracle official documentation, but it’ll result in an incomplete install… If you install the RPM, probably nothing will work because by default no library files are installed where the system will automatically access them(The SDB and my scripts do that). If you install the TAR, you <must> uninstall any previous Java (new install will over-write many files anyway) and update-alternatives will be setup but next to useless.

  • I did another Internet check within this past week on various SUSE and Fedora “how to” posted on how to install Oracle JDK 8 and found them all badly lacking. They all seem to describe how to install the main JRE and JDK binaries and setup update-alternatives, but nothing more. For that reason, I <highly doubt> anything related to something like JavaFX is setup properly.

  • Currently Oracle Java 7 can be installed and working fully. The SDB describes how to install the JDK (or JRE) fully (all libraries, binaries, man files) and setup update alternatives. If you use the script files I created, it improves on the SDB with the additional benefits

    • You can install and switch between multiple JRE, JDK, and more (beware, the original SDB does not support this)
    • <All> man files are made accessible
    • It’d probably take over 30 min to install following the SDB, maybe much, much longer. Running my script files should take less than 30 seconds (typically 15 seconds in my virtual machines)
  • Unless you really need an Oracle 8 feature, I’d highly recommend building in Oracle 7 today anyway. Almost everyone has Oracle 7 installed, Oracle 8 is not yet installed everywhere and is not available yet for some platforms (eg mobile devices).

Regarding my Oracle JDK 7 scripts, they are on my Github
https://github.com/putztzu/openSUSE_Oracle_Java_Install
The SDB is here, but <read the discussion tab> which describes a number of suggested updates including mine
https://en.opensuse.org/SDB:Installing_Java

If anyone wants to co-operate with me on creating a procedure for installing Oracle 8 properly on openSUSE, you can PM me…
I’ve already spent a little time and determined that although about 90% of my scripts would work fine with Oracle 8, the 10& that won’t due to major changes are pretty important.

TSU

FYI -
I am taking another look at installing the Oracle 8 JDK,

I think I have specifically addressed implementing JavaFX, but am working on a complete solution to deploying the entire JDK.

If things go as expected, should have a Beta test perhaps by June 13.

TSU