I wish to give some demo copies of a Java application on a DVD to a client. Does it make sense to have a preinstalled JRE and Java application on a DVD so that they can just click and run it?
Also, if anyone has done this what are your views on this?
I would suggest you skip the DVD and go for a flash drive instead. This way you can use portable Java and run your app from the flash drive without having to install anything on your client's computer. With the low costs of flash drives these days you should easily earn back what you spend in money in convenience and time.
Here is a tutorial that shows you how to set this up.
Indeed you can simply put a JRE into a directory of the DVD.
Then you start the application with a .bat file that runs a command such as :
jre\bin\java.exe -jar Main.jar
(If your jar and the jre folder are in the same directory)
Be careful about one thing : you can't know in advance what the DVD's drive letter will be, so in your .bat file you must give relative paths to the JRE and to your jar (or starting class).
If you are dealing with a one or two people then just throw a JRE on the DVD and explain how to install it or even just include a link to the page where they can install Java themselves. In the past when dealing with a large set of recipients that needed to install a JRE and run an application, I have used tools like InstallAnywhere, to create a simple setup to walk the user through a wizard for setup.
I've in the past copied a windows JRE directory to a USB flash drive, and run a java app off that.
If:
The users have an internet connection
The demos. have a GUI
You can deliver them off a site
..I would recommend using deployJava.js to ensure a suitable minimum JRE, & Java Web Start to download/install & launch the demos.
JWS has a number of advantages in this situation:
Server hits for the resources will reveal what proportion of the people to whom the demo. was delivered, are actually trying it.
JWS offers 'lazy downloads' so that if a potential user is only interested in one small section of a large application, they do not have to download the entire binary.
If the user turns a demo. into a registered version, (at least parts of) the app. will be already installed.
But in the event that it is a constantly changing app., JWS will automatically update any new parts of the app.
All this is part of the 'one click' installation experience for JWS. It is more tricky for a developer to set up, but once done well, is a breeze for the end-user.
You might include an HTML page on the CD (DVD would be a waste for a single HTML, a couple of images & some CSS based style sheets) that links to the demos. But since the hardest thing about getting a user to try a demo. is getting them to put the disk in the drive, I would side-step the disk entirely & send the 'Here are some free demos.' HTML to the user as email.
This was included as a comment a couple of days ago. Since the thread was resurrected, I decided to include it as an answer & expand on it.
Related
I'm using IntelliJ IDEA, I have coded a frame which I want to put into an HTML file so I can run it in my browser, how do I do this now that I cannot use JApplet? I have found this documentation: http://docs.oracle.com/javase/tutorial/deployment/webstart/deploying.html and this http://docs.oracle.com/javase/tutorial/deployment/webstart/deploying.html but I am new to programming and find this difficult to follow. I don't know for instance how I would go about putting my class files and the image that I used in a separate directory nor do I know how I go about signing my application so that it will run in a browser.
I want to put into an HTML file so I can run it in my browser,
You can use the Desktop class. This class allows you to access default applications from your desktop.
Read the section from the Swing tutorial o How to Integrate With the Desktop class for more information and working examples.
See Java Plugin support deprecated and Moving to a Plugin-Free Web.
Note that is one of my 'copy/paste comments' that does not explicitly mention JFrame based apps., however the links are still relevant in that Oracle & browser makers would not be phasing out support for applets if they wanted programmers to keep trying to shove rich client apps (e.g. Swing GUIs) into thin client web pages.
OTOH you can offer a JFrame (or a JApplet) to be launched from a link in a web page to end up free floating on the desktop of the user by using Java Web Start.
Even then, it is not a simple matter for the programmer or the end user. The programmer needs to ensure the app is digitally signed using a code signing certificate issued by a CA (usually they are expensive). The end user used to just be able to click the link, 'OK' the prompts produced by the Java virtual machine, and see the app appear on-screen. But now most browsers will download the launch file to the local file system rather than directly hand it to the JVM to be launched. So the user faces an extra step in explicitly finding the downloaded launch file and double clicking it.
This is all due to security concerns related to bugs in the plug-ins that run things in web pages. So if you were to find a way around all these hoops, please let us know. It is a security bug that requires urgent fixing.
some questions:
i unzipped the full offline distribution (400+ mb) to C:\Program Files\Play2.4
Unzipping created a directory "activator-dist-1.3.5" within which are bin, lib, repository, templates, etc.
i assume i put the contents of activator-dist-1.3.5 into C:\Program Files\Play2.4?
i setup an user environment variable name: PLAY_HOME, value: C:\Program Files\Play2.4 and then added ;%PLAY_HOME% to the end of the system variable "Path"
i've tried calling "play" from dos both with and without "activator-dist-1.3.5" directory and both return "play is not recognized as an internal or external command"
some other answers to this question mention the root play dir should have "play.bat" but all i see is "activator.bat"
i read readme.html and opened activator.bat, it launched a dos window, which promptly closed.
http://localhost:8888/home goes nowhere.
For those who don't yet speak "play", what is Activator UI?
Since play 2.3, the play command was replaced with the activator command. Take a look to this.
If you put the folder activator-dist-1.3.5 into C:\Program Files\Play2.4 then your enviroment variable must be set to C:\Program Files\Play2.4\activator-dist-1.3.5\bin. You can also put that path directly into the PATH environment variable.
Activator UI is a web aplication that helps you create play applications. You can think of it as the graphical version of the activator command line tool. Here is the documentation
ok, here is what ive figured out:
the environment variable has to point to the bin directory (thx Victor)
from w/in dos window (the "console"), cd to the the root play dir (not bin) and type "activator" not "play"
all other documentation and stackoverflow answers refer to the pre 2.3 versions of play and will not help you.
then a bunch of stuff happens: online maven call (even though i downloaded the offline dist) and a bunch of calls to the play root dir/repository for jars.
of course localhost:9000 and localhost:8888 still get connection refused.
now if you manually open activator.bat in root play dir it launches another dos window, makes a network call (firewall allow) and opens a browser win to: http://127.0.0.1:8888/home which is some sort of "welcome to activator" screen with sample apps .. sort of like the tomcat mngt page.
i hope to only define and start/stop apps from w/in my IDE, so eventually i'll be looking for how to disable this default activator behavior
next up.. how to setup intelliJ:
i went here: https://www.playframework.com/documentation/2.4.x/IDE and defined an SBt task instead of a play task in run/debug configurations of my new project.
now project start makes maven calls for jars but then dies on:
[error] Server access Error: Connection timed out: connect url=...repo.typesafe.com/typesafe/ivy-releases/org.apache/apache/14/jars/apache.jar
stopping and restarting did a bunch more maven calls (really slow) but eventually "done updating" and localhost:9000/ now shows welcome screen :)
not completely painless but certainly simpler than a spring app
onEdit:
sorry play, but i've moved to spring boot because:
i create new projects by copying existing and making changes. its much faster than creating a new proj from scratch. Thus the activator thing (which does not work) is not useful to me and just represents a security prob (like apache web management screen) that need be disabled
no where is there a clear, concise and complete list of settings to get play running correctly in intelliJ (the 2nd most popular IDE avail)
asynchronous, non-blocking and micro services are not unique to play and spring (or others) can be made to work in a similar fashion
We have so many technologies to learn and it does'nt make sense to invest a lot of time mastering one with limited corporate buy in
i want to stop/start from w/in my IDE and not have to have a bunch of dos windows open. i know this is possible in play, but documentation makes it feel as though its not the preferred method
although i appreciate that the play directory structure is less flexible, its still not the command/controller/manager/dao/model world that is the most often seen for java apps
i investigated play because spring was getting to the point of having too many ways to configure too many things in too many places that were documented differently across versions. Also, large sub-projects in spring (like security) garnered their own books on the subject because they were so complex to figure out. At the end of the day, the level of security (for example) needed (or the manner in was implemented) went beyond what avail via simple configuration and after all the customization we were left wondering whether spring security just got in the way instead of providing real time saving and usefulness.
Spring boot hopes to help in that its an opinionated configuration where a collection of configuration basic best practices are encouraged/enforced.
and lets re real.. time saving on a slightly more concise language or a slightly different proj structure or dynamic class loading is not whats important.
The majority of time spent on projects, by far, is the time spent researching, thinking and investigating architectures, technologies, databases and presentation schemes.
I prob only spend 20% of my time coding and 80% trying to figure out the strategic vision needed to create software that has maximum usefulness and is "future friendly" (not needing to be re-coded every 3 years)
so far i've deleted my project and recreated about 10 times.. trying diff settings, still w/ no luck.
checking google play mailing group, i tried to create via activator ui.. but could not launch activator until i deleted the RUNNING_PID file in the play root dir
now i'm back at: http://127.0.0.1:8888/home to create a new app
at create new proj i get error: "cannot find project/build.properties".
lets try adding a blank build.properties where its expected.. nope, error: "destination already has files in it"
not that it really matters, sample templates have no knowledge of IDE and thus provide no insight into how to configure IJ. New\Import project does not list IJ as an option in choosing an external model
...whatever...
"Mr McKitrick.. after careful consideration ..."
trying to get working in IJ 14 ultimate:
jamesward.com has a tutorial and video, but its for older versions of IJ and play and only covers a small % of necc. configurations.
jetbrains has a tutorial but it also only covers play 2 and older IJ which does not translate to 14 and 2.4
https://www.playframework.com/documentation/2.4.x/IDE helps, but just w/ setting up an SBT Task
all the other project settings are a mystery for example:
project source need be defined to even show your project directories in proj tree
facet setup add does not list scala as option
why is scala lib pointing to users[me].ivy2\cache..? (i would think all necc libs are w/in play root\lib
should i setup a global lib pointed to play\lib?
run/debug config need env var pointed to PLAY_HOME?
basically all classes are not being resolved in IJ editor.
project structure lists 109 problems like:
Library SBT: joda-time:joda-time:2.3:jar is not used [Fix]
seems like i'm missing a global lib definition.
i'm able to get my app running, but i dont know how useful its going to be when the 2nd most popular IDE throws red bars at every import: "play."
I have already asked this and was heavily downvoted. Unfortunately, I still can't solve it. I don't know what I do, but sooner or later I loose an ability to run java applets and java web start applications in all browsers.
Here is an example what is happening.
I am opening page with applets http://csis.pace.edu/~bergin/Java/applets.htm and getting the following picture:
with signs plugins were blocked. I am trying to unblock
which causes another dialog
after OK I have another
next
if clicked
And so on.
Applet doesn't run.
After dancing with PATHes, Java updates and so one, once I can have applet run. But sooner or later I will stuck in this position again.
I would like to know, is it possible to exclude this situation in principle?
I mean I don't want to disable security at all, but I mean that in case my explicit permission everything should run. Is it possible to do that?
UPDATE
First of all, I don't understand, why can't I run applet on outdated java if I want?
I am a human and robots should obey me! :)
Suppose I wish to debug my applet on old version of java, why not?
Second, there is no information about what version it thinks I have and what version it wants?
Without this information it is possible that there is just a bug in version detection mechanism.
I have multiple versions of Java in Program Files since I am a Java developer. Then how can I know which one it uses?
UPDATE 2
I have updated my Java from 1.8.0_20 to 1.8.0_25 and now situation have changed, but applets are sill impossible to run.
The proof I have "latest" java:
The proof I have added the site above to exclusions list:
The effect of applet run:
(applet not runs)
Clicking details result:
(no any details in fact)
So, what to do?
UPDATE 3
This site is not working: http://ssd.jpl.nasa.gov/sbdb.cgi?sstr=2012VP113;orb=1;cov=0;log=0;cad=0#orb
(show orbit diagram)
Reloading/restarting browser does not help.
I looked at your html source and realized you're using the .class file directly instead of wrapping it in a jar file. This is what you have:
<applet code="GSort.class" width=700 height=400>
I think applets no longer work when using .class files directly due to new security requirements. They have to be wrapped in jar files because you need to add some security settings to the meta-inf folder of the jar file. Here is how oracle recommends deploying an applet:
https://docs.oracle.com/javase/tutorial/deployment/applet/deployingApplet.html
Edit:
I tried again with adding the site url to the Java security exception list and this time I got it to work! It looks like chrome stays in memory after exiting so changing Java security doesn't affect it unless you shut down chrome completely and restart it. Easiest way is to use Internet Explorer. Try it with Internet Explorer and it should work (assuming that you still have the site added under java security exception list).
I have installed SIPDROID. I made three account at sip2sip.
After that I have configured application using one of that account. Application works fine.
Question is: If I make multiple call to the same phone using SIP is there anyway to handle all calls at a same time?
Another incoming call is not displaying on mobile screen while first call is continue.
The first call getting picked up but what about the second call which is coming during first call.
Even second call is not displaying on the screen. Confused !!
Sipdroid that I what started with but after researching on it and from developers reviews I found that application has some missing functionality like multiple call and transferring calls etc...
I don't know but may who is expert in sip stack or have time to do can implement missing functionality but I am neither one of them so my desire to get an application that have all this functionality and by modifying it I can integrate into my application and csipsimple is the answer.
However its not easy job to build csipsimple into windows environment but there is hack how to do it. so carefully read its wiki about building project into window environment.
According to wiki you can build native library or you can go ahead without building the native library. I suggest for windows user to go with without building the native library.
If you have read wiki then in "without building the native library" section last line is like
"To get the .so files, download latest nightly build from nightly
build website and unpack the apk file (apk files are just zip files).
Then get lib/ARCH/.so files and copy it into CSipSimple
libs/ARCH/.so"
I have to clarify one important thing about that:
First get .apk file of csipsimple. The version of .apk file must same to download version of your csipsimple source code..
Here, you can see the source code version. Download the same version .apk and do further as described in wiki.
SipDroid supports only one line at all times. This means you cannot have conference calls. So to the question:
If I make multiple call to the same phone using SIP is there anyway to
handle all calls at a same time?
Nope, you cannot handle simultaneous calls at the same time. Fortunately there's another open source SIP Client that supports multiple lines - IMSDroid.
Though you can extend SipDroid to support multiple lines, that's a lot of effort. The main objects you have to pay attention to in order to support multiple lines are:
UserAgent, SipProvider (note that it's designed to support multiplexing/demultiplexing of SIP messages), JAudioLauncher and the Call object.
The bug you're describing with the second call not showing is not something I have witnessed. This could be due to your device setup, or due to customizations performed on the original code...
you can build the csipsimple easily in linux OS... All you have to do is just paste the download source link in linux commanpropmt and for windows you must have latest cygwin software to download or to build native library... Better option is to go for linux OS only...
I have a program (java jar file) that I want to distribute on CDs. My friend told me that there are free/open-source CD installers available that automatically install your program onto the customer's computer.
Now I can't seem to find this on Google. So are there any CD installers that you would recommend that I can use (so I don't need to program one myself).
Outline:
My program consists of class files, sound files, source files (i'm open source) and images (packaged into a jar file).
I only need the installer to work for Windows computers.
I think IzPack does something like that.
You can look into Java WebStart which in Java 6 was enhanced to allow "launch-from-cd-and-install-to-harddrive" which mean that it can work as a very simple installer.
It requires a JVM already present. You can put the redistributable JRE on the cd too.
Launch4J is what I have used as my installer. It is really lightweight and has a nice GUI that makes things simple for the developer (one reason I chose not to use IzPack).
It makes things dead simple for both the developer and the user.
Your jar file is wrapped in a exe launcher.
If an up to date JRE is not detected, a bundled JRE is used or the user is prompted to download via java.com/download
Really, I couldn't have asked for anything simpler/better. Although you might get more functionality out of IzPack, if you want something dirt quick that can do everything the everyday developer needs, go for Launch4J.
P.S. Their splash screen option is a nice bonus :)
After running into numerous end problems, I finished the job with the use of Inno Setup.
Very quick and easy to use. Creates an installer similar to the ones you would see in popular programs. Gives you (and the user) the ability to create Desktop Shortcuts, QuickLaunch Icons and Startup folders. Allows you to add license information etc. Very simple and intuitive interface, I didn't have to read any documentation!
A big con: Only makes installers for windows. That met my requirements, but may not work for everyone.