Javafx project native packaging with Java 11 - java

I am currently learning Java and javafx. Now I am able to make some simple Javafx applications so next step to me is to package my application with JDK and JavaFX so that it can be installed and run without having to install JRE.
I know that the way of making self contained package is quite different from what I can do in Java 8; and I tried to search some tutorials on this. But there are few discussions and tutorials about native packaging in Java 11. Those topics I can found are also kind of difficult for me. Can anyone give an instruction about what tools should I use (for developing I use Eclipse)? And how to create self contained application package from scratch?

Related

Java SWT application and Standalone Eclipse Help System

I am maintaining a Java application developed using Java SWT. This application uses the Eclipse Help System.
I have an Eclipse Help plugin developed and I would like to reuse it.
The current solution packs the help as a "Standalone help" as is described in Help Eclipse documentation. In this way an independent Eclipse Platform Runtime has the Help plugin and my application make API calls from its Help.
(The help works properly). The drawback of this solution is that a complete Eclipse platform is included (and distributed).
I would like to avoid the use of the "independent Eclipse Platform Runtime" and I wonder if it would be possible. I.e. I would like to avoid the distribution of the complete Eclipse platform which is in fact bigger than the application I am maintaining.
A possible solution would be to use Javahelp instead, but Javahelp uses Java Swing and my Application is uses Java SWT.
I’ve created an RCP project that calls the Help plugin.
Would it be possible that my Java application calls to the RCP project and
the RCP project calls to the help without needing any additional action like push a button?
Another problem that I have observed is in order to call help plugin from RCP project, the RCP project needs to show its window. Is possible to avoid this?

Which flavor of eclipse to download in order to start developing with GWT?

I am new to the world of Java and web programming. Never wrote a single line of javascript and my knowledge of HTML is pretty basic. Although, I am very experienced with .NET, so I guess transition to Java should not be a revolution.
Anyway, I wish to learn GWT and for that I want to work on Eclipse (I have Mac at home, so no Visual Studio).
Now, there are a dozen different download flavors of Eclipse, so my question is - which one best suits my needs?
Thanks.
P.S.
This is probably not a factor in the decision, but I will need Visual Studio keyboard bindings. I want to believe that no matter which flavor I install, I will be able to change the keyboard bindings later.
You should be fine with any version of Eclipse. Eclipse is extremely modular so it's only really a case of ensuring you have the correct plugins installed.
I'd recommend:
Start with the Eclipse IDE for Java Developers as a base install. This has everything you need for Java (i.e. the Java Development Tools, stndard editor features, source code control etc.)
Then install the GWT plugin for Eclipse
After that you should be good to go. If you find you need more plugins later, you can easily add them.
I also know both .NET and Java, and you should not have have much difficulty making the transition - it's really just a case of learning a few slightly different conventions, APIs and ways of doing things.
With regards to the keyboard bindings, I've never really changed from the default settings myself but they are completely customizable so I'm sure you can get it set up how you want. You might want to look at the answers to this question, which give you a few options (apparently you can download the full set of bindings, or install the C++ plugin which includes them).
I would probably start by installing Eclipse for Java EE developers and then the GWT plugin. It will cause less dependencies to be installed and you will get some things installed that you will probably want to start using later. But regardless of whether you are using that or the Java developer-version you should not have any major problems.

How can I create a .msi file for a Java program ? (eclipse)

I have a java project which I'm hoping to package and sell. How can I create a .msi file which will install my program on other windows computers?
If there are any tutorials, please direct me to them. I'm also using Eclipse if that has any bearing on how to create the .msi file.
Thanks
I've been using WiX extensively for creating MSI packages. It has quite a steep learning curve, but once you know what you're doing, it is very powerful. You said earlier that it needs Visual Studio installed, but I think it's just .NET 3.0, not the whole IDE.
I used this WiX tutorial when I got started, and it's got pretty much everything you need in there if you want to go down this route.
If you're after something simple, search for a tool called WixEdit on SourceForge. This has a GUI for building MSIs - it's not perfect, but pretty easy to use and produces professional results.
I'll repeat, WiX has a very steep learning curve, and if you're just after a simple way to package your application, NSIS might be easier; or, you could use the standard IExpress.exe tool built into Windows to create a self-extracting .exe (but they don't "feel" as good as an MSI).
There's nothing special about Java apps when it comes to creating MSI's other then you have to make sure you have a JVM/JRE installed just like you have to make sure the .NET framework is installed for .NET applications.
Your question is too broad to be able to answer. Implicit in your question is "What tool should I use?" and once that's decided "How do I make an MSI using this tool?"
For the first question, check out:
Windows Installer Authoring Tools for Developers
Use NSIS: http://nsis.sourceforge.net/Main_Page . It creates executable file that will do the same thing, and it is free.
If you specifically want to create an MSI package, and assuming you don't want to pay for something like InstallShield, look at Wix. http://wix.sourceforge.net/
I believe you want to look at Native Packaging, which according to this link was first introduced with JavaFX 2.2
https://netbeans.org/kb/docs/java/native_pkg.html
Since it seems to be official Netbeans docs, I imagine it is sanctioned by Oracle. Here is the counterpart for Mac for interested readers.
http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/packagingAppsForMac.html

How do I distribute a JOGL application?

I've written an application the builds fine on my machine but when I move it to another machine the dependent JOGL libraries cannot be found.
Is it possible to create a build that sets up all the required JOGL files so that you can distribute your Java application with the necessary JOGL libraries?
If someone could explain this in NetBeans that'd be appreciated too.
Thanks,
James
I wrote a tutorial about how to create redistributable JOGL apps for multiple platforms. The tutorial uses Eclipse instead of NetBeans, but the principles should be the same. You can use this system to build JOGL apps that are completely self-contained, so they don't even require the user to have Java installed.
The tutorial is on my blog at http://wadeawalker.wordpress.com/2010/10/24/tutorial-creating-native-binary-executables-for-multi-platform-java-apps-with-opengl-and-eclipse-rcp/.
This usually happens because the libraries are located on your machine somewhere, which is the way that most tutorials recommend that you install JOGL. The key is to add the JOGL libraries inside your project, and point the project to use those rather than the libraries on your machine. You should then be able to package the application.
Note that because the JOGL bindings are platform-dependent, it means (for example) that if you wrote this on a Mac and try to deploy to Windows, it won't work because the native calls aren't available.
We usually distribute our JOGL based applications using Jnlp. This allows the automatic platform detection from the JNLP Launcher to kick in as well as the use of recent versions of Jogl Libraries. If you would like to see how to craft a proper JNLP look at the samples on this page for NASA WorldWind.
You can use Java Webstart to deploy an application using JOGL, it is explained here:
http://jogamp.org/jogl/doc/deployment/JOGL-DEPLOYMENT.html
Look at my own JNLP file if you want:
http://tuer.sourceforge.net/tuer.jnlp
Edit.: I use JNDT now, it works a lot better :)

Start coding in Java with NetBeans

There is a lot of information about Java around, but I don't understand how to setup everything.
I have a Mac. I heard the JDK comes with Macs. But is it the latest? How do I check that? Is it the J2SE or J2EE?
I want to create a web app. I installed NetBeans. When I choose create project there is a list of Java options. There is Java/Java EE/Java FX/Java Web. Which one should i choose? and afterwards, what is what? What is War?
I want to find a good tutorial/ebook explaining all these Java terms and how to setup Java/Java Server(Glassfish/Tomcat) on a Mac and with NetBeans to code a web app? A good one!
The netbeans tutorials can be found here: http://netbeans.org/kb/trails/java-se.html
To start off, just make a plain Java project. The other types all probably include different plugins or libraries that you won't need right away. A WAR is an archive of Java classes and other files that constitutes a web application.
The default version of the JDK that you have on your Mac should be fine, but if you want to upgrade or mess around with any other Java preferences, OS X offers all that for you. Apple has a good tutorial here: http://developer.apple.com/java/faq/
Edit: Ok, if you want to make a web app then the first step is to learn how a Java web app is organized. That will make your life much easier. Java EE is mostly a buzzword (IMO) and it refers to a specific set of libraries. It's not important to know what's officially considered Java EE and what isn't. To learn about what a Java web app looks like, the best place is the Tomcat manual. Read this section, then make a WAR project in Netbeans and you should have a good start. Don't try to bite off too much at first, just make a Hello, World! app.
An excellent resource for learning Java development is Java Passion.
There you can learn basic Java development, and the Java EE tutorials will also get you started developing web applications.
Here are some links on how to setup Tomcat / Glassfish for Mac OS X.
Tomcat on OS X
Glassfish on OS X
Trying to go straight into Java Enterprise Development is going to be too steep a learning curve unless you already know Java. Take a step back, and start going through some Java Tutorials.
It will likely be a while before you can tackle Java EE (it can be a monster).

Categories

Resources