How do I distribute a JOGL application? - java

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 :)

Related

Installer for Java Desktop Application

I am developing an inventory system i-e a java desktop application. I am using Ms Access as database engine and there are certain modules e.g one makes reports using ireport and other such dependencies. I need to ask how can I make installer for my application which will install few fonts, copy database files, install jre to make it run etc. Please guide me in it.
Thanks in anticipation.
This is something I've briefly used in the past, and it may serve your needs. It's an open source installer builder system, tailored towards Java apps.
http://izpack.org/
I've used jsmooth which creates a single EXE-file that unpacks and run transparently. Not a full installer but worked well for us.
Note: I have not seen any Java installers which asks the "There is an update available. Update now?" question.
If this is important to you, then consider Java WebStart which checks for updates at each launch (but do not ask).

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

Select SWT Library depending on OS

How do I ensure when I distribute a JAR-file that the proper SWT-library (either the windows, the linux or mac version) is loaded an ready to use?
It would be very helpful because then you can do one export and your application can run on any platform like Swing apps usually do.
Thanks a lot
This can be done with a loader class as described in this answer: Create cross platform Java SWT Application
You looking for the delta-pack. The delta pack archive contains all the platform specific fragments from the Eclipse SDK.
See http://aniefer.blogspot.com/2009/06/using-deltapack-in-eclipse-35.html
Thanks a lot for the answer.
Sounds like I have to distribute my app per platform.
In comparison to Swing this is a disadvantage, but I love the native widgets ;)

How to make installer of java desktop application for multi-platform?

How could we made a jar file's installer, which can run on multi-platform. Is there any simple way, because I don't know Java much well.
Balwant
Installer tools for Java have been dealt with in quite many questions on SO, and most options have probably been mentioned already:
What’s the best way to distribute Java applications?
Java Application Installers
What is the best installation tool for java?
See also other questions tagged java+installer.
If a commercial tool is ok, the best multi-platform installer for Java software, to my knowledge, is install4j; I can definitely recommend it (more about my experiences with it).
Nearly half of our BitRock InstallBuilder customers use it for Java deployment. It is multiplatform and runs in all the major platforms such as Windows, Linux, Mac, Solaris, HP-UX (and most of the obscure ones too :)
izPack is pretty nifty and supports multi-platform installations.
If the target audience have access to the web, you could have a look on Java Web Start which allows you to basically do all you need.
It requires the user to click a link and download.
Well the best way is to use InstallAnywhere that is good for install or packagging any of the applicaion in desktop.
here theInstallAnywhere go to site register your self and download one trial verson.

javafx on client side

Do the clients need something else than a proper jdk and javafx compliant browser to visit javafx applets?
JavaFX is based on download able JARs. I think there are multiple runtimes, but all of them Require JRE 1.6. The JavaFX classes will be loaded by the WebStart or Applet Classloader, so the JRE does not need to provide this extension.
However as there are some new Features of Java 6 Update 10 specifically targeted for rolling out JavaFX applets, it is most likely that this is the best choice. Update 10 has a new Java Plugin with improvements in speed, installation and stability, and it allows quicker initial installation.
The following JNLP Samples with fine with the released Java 6u10:
http://javafx.com/htdocs/samples.html
http://a.stritzinger.googlepages.com/jfxrace
Ok, thanks for this information. All the samples were "standalone" applications that run "outside" the web browser (a new program was launched, you had to download it and accept some signatures/certs). Is it possible to run the applets inside a browser? (more transparency for my client)
JavFX can be run as an applet and the Java plug-in for running applets was rewritten for Java 6ul10 to provide a better experience for everyone for the JavaFX release.
You can see plenty of applet examples at JavaFX.com as well as the samples in the Netbeans 6.5 JavaFX plugin.

Categories

Resources