Can I run a JavaFX application via Web Start with Java 6? - java

I want to offer a JavaFX-Application online via WebStart.
Is it possible to launch the application if the user only has JDK 1.6?
If it isn't possible "out of the box", can I somehow include the neccessary jars in the application?

I am pretty sure that Java FX was usable in later versions of 1.6.
It is neither legal nor practical to supply the JRE (or separately Java FX) in Jars.
The best way to deploy a JWS app. or applet is to use the Deployment Toolkit Script.

Related

setting your IDE(eclipse) for java desktop application

I've an the Eclipse IDE with android sdk as I am an android developer. I want to develop a simple java desktop application consists of splash screen and a login screen which is connect to MS SQL through JDBC. Now, how will I enable my Eclipse to let me develop java desktop applications. or shall I use net beans. I have also downloaded the netbeans 8.0 but it not showing me the java desktop application. Also, I have installed and unzip the JDBC driver,there are 2 jar files sqlJDBC and sqlJDBC4. Please kindly tell me which jar file shall i use.
Eclipse IDE with android sdk have Java already installed. I use the same eclipse for my Android and swing development. Just go to File and create a new Java project. See the screenshot of my eclipse for better understanding:
Since you've been using Eclipse with Android SDK, you probably have Java already installed and you don't need to worry about downloading extra libraries to use the Swing framework.
To start in Swing, take a look at the official Swing tutorials to learn how to develop desktop applications. After you've learned the basics, try to incorporate JDBC drivers to connect to your SQL Server.
You should add the sqljdbc4.jar Class 4 JDBC file to your Java Build Path to make a connection to your SQL Server.
Since you will be building desktop applications, you will most likely need an IDE which allows you to visually build the UI. This usually makes development quicker.
That being said, unlike Netbeans, Eclipse does not come with a GUI builder out of the box. You will need to find and install a plugin which works for you (check here for some of them, if you are using Swing).
In Netbeans, you should be able to simply create a Java Application to which you add JFrames and other UI components.
That being said, the Swing platform is giving way to the JavaFx platform, so if you are building something from scratch, I would recommend you give this a look since it should offer a richer way to build the User Interface.

Windows/Linux installer for Java program

I have several Java applications. All of them have external jar dependencies and also require a couple of .dll/.so files to run. I want to build an installer for these applications, that will run properly just by double-clicking the installed program. What tools are available to do this ?
Thanks in advance.
For Windows Izpack is good tool. Also native implementation available.
But for Linux the best is to install it with a .sh script.
Edit
The reason for this is that when you use a .sh script, you can check if java is installed and install it if it's not present. As I am aware- Izpack still lacks this feature.
..run properly just by double-clicking the installed program
This implies a rich client desktop app. rather than one based on the command line. In that case, the best deployment technology is Java Web Start.
Java Web Start (JWS) is the Oracle Corporation technology used to launch rich client (Swing, AWT, SWT) desktop applications directly from a network or internet link. It offers 'one click' installation for platforms that support Java.
JWS provides many appealing features including, but not limited to, splash screens, desktop integration, file associations, automatic update (including lazy downloads and programmatic control of updates), partitioning of natives & other resource downloads by platform, architecture or Java version, configuration of run-time environment (minimum J2SE version, run-time options, RAM etc.), easy management of common resources using extensions..

Provide download link for Java when not installed

I'm writing a Java applet for a small game. When a user doesn't have Java installed, I would like to provide some sort of help. Automatically downloading Java is most likely not an option. How would I go about detecting if Java is installed, and showing a OS-appropriate download button if it's not?
Thanks in advance,
Look into JNLP (also called Java Web Start). Here are a couple tutorials:
Deploying a Java Web Start Application.
Deploying an applet
What's nice about JNLP is that you don't have to code anything, it's already been done for you. And it allows for the automatic download of a JRE if it's not installed.
Use deployJava.js to ensure that a suitable JRE is installed (and then it will write the applet element).

Need Help in Running My Java App

I had created a Java Swing Application, I want to run my applications, in all System, Suppose if a System, does not have JRE, then i have to install JRE using Installer in program without aware of the user knowledgeable that the JRE is installed.
There were a few projects for doing this, but from what I can see they all fizzled out - bottom line seems to be that you need a JRE - especially for swing
The best solution is not to try and install anything silently, but instead to assist the user to install Java. Oracle's deployJava.js was designed to do just that, before embedding applets or launching Java Web Start applications.
While on the subject of JWS, it is also a good choice for installing/running & updating Java rich client (e.g. Swing) apps. on platforms that support Java.
You can generate an EXE out of your Java source but you will still need the JVM to run it on the destination System. So its not real native.
There is no workaround for running non native class files reliably or really at all without the JRE.

Dev server for Java, like VS has for .NET?

I am on a Java learning spree recently, however I am normally a .NET developer. (So please forgive my newbie questions.)
In .Net I can develop ASP.Net pages without using IIS, as it has a watered down web server (Cassini, I think it's called).
Does Java or a Java IDE have something similar so I can write and test JSP and Java Servlets without the need of a full-blown app server (Tomcat etc.)?
Also if there is one, does it work on Windows?
Tomcat actually isn't a fullblown appserver. It's just a servlet container (i.e. implementing only web component of the (indeed huge) Java EE API) It's only around 6MB big. Glassfish, JBossAS, Weblogic and Websphere as being full Java EE API implementations may be called as "fullblown appservers".
You can also consider Eclipse Jetty. It has a small footprint (download is only 2.2MB) and is useable as an embedded server and even runnable from a plain vanilla Java class.
As to IDE's, both Tomcat and Jetty are by default supported in "Eclipse for Java EE developers". You can easily integrate them in Servers view and then just associate your web project with it. Here's a nice video tutorial how to get started with servlet development with Eclipse and Tomcat.
As to working on Windows, Java is platform independent. You just need to have a platform-compatible JRE installed. Then any Java software will be able to run on the particular platform. Sun has a JRE for Windows --which is by the way also included in the JDK, if you already have one.
In the Java world the usual way to develop JSP based applications is to have a web container like Tomcat inside the IDE, and there are many ways to do it.
The easiest way to get started is to use Netbeans with a bundled web container - download the "Java" one from http://netbeans.org/downloads/index.html and install it.
After starting Netbeans 6.8, "File -> New project", choose "Java Web" to the left, and "Web application" to the right, and "Next". "Next". "Next". "Finish".
The editor now opens on "index.jsp" in a new project. Select "Debug -> Debug Main Project" and after a while a browser opens showing "index.jsp".
Switch back to Netbeans. Insert this line
<%= new java.util.Date() %>
just before the </body> end tag, and save with Ctrl-S (or "File -> Save").
Switch back to the browser. Reload the page. See the date shown. Repeat :)
That's it.
You can hook up your ant scripts to hot deploy to a local tomcat instance. That's the closest thing I can think of to the .NET development environment.
Eclipse can embed a dev version of Tomcat, and most other IDEs offer a dev server too, I should think.
But also I should also point out that obtaining & setting up Tomcat is quite a bit simpler than setting up IIS. Just download a zip file and unzip -- poof! you're done!
When I was playing with JSP a while back I used NetBeans which has a Web & Java EE-installer, that
Provides tools for developing Java SE,
Java EE, and web applications. This
download option also includes the
GlassFish V2 UR2 application server
and Apache Tomcat software.
Try Jetty http://jetty.codehaus.org/jetty/
Jetty is an Open Source HTTP Servlet Server written in 100% Java. It is designed to be light weight, high performance, embeddable, extensible and flexible, thus making it an ideal platform for serving dynamic HTTP requests from any Java application.
EDIT: corrected link.

Categories