Embedded IE (COM application) in Java application - java

As same as the title, is that possible to achieve this right now. Since I have already had application that works on web browser. I want to create a java version app which just simply load the URL and performs most of the functionality as the web browser.
I have tried to use JavaFx webEngine, it can show the content of the page, but it does not support upload or download. For simplicity reason, I do not wish to rewrite code to handle upload/download or even more duplicate stuffs in feature.
I have tried JDIC, but seems it is abandon project and I have got such error:
org.jdesktop.jdic.init.JdicInitException: java.lang.UnsatisfiedLinkError: no jdic in java.library.path
I do add the jdic.jar which I download from nowhere to the lib path.
I also tried this link (http://www.codeproject.com/Articles/514/Embed-ActiveX-controls-inside-Java-GUI), but it is from 10 years ago and some components have been remove from JDK.
Any help will be appreciated!

Related

WebStart Launching attempts to find jar locally

To start off, I am launching a jar over Java webstart and it has worked fine on all browsers in my lab. An issue arises where, at a customer site with all their various IT restrictions, it only seems to work on Chrome but fails on IE and Safari browsers.
I launch the jnlp via an html file through the browser. The link I used was:
<script src="https://www.java.com/js/deployJava.js"></script>
Launch ApplicationApplication</a>
I attempted to change this to:
<script src="https://www.java.com/js/deployJava.js"></script>
Launch Application
Reason being is my company has another webstart app that works in all browsers at this customer's site and their link looks more like the replacement.
So what I'm seeing with the replacement is that the JNLP is not being launched from the browser but instead being downloaded locally. When launched it attempts to find the jar relative to where it was downloaded. Not sure what I'm missing and why it is trying to download instead of launch via webstart?
Any ideas? Thank you!
I have been fighting with this a lot in the past. So couple of rules in general needs to be followed in order to go smoothly.
make sure your URL where jnlp sits is not cached, maybe you need to develop some Pragma No Cache, etc. things on the server so it doesn't treat it as static resource
clear cache of JNLP, see https://www.java.com/en/download/help/plugin_cache.xml
Check the shortcut icon on Desktop(assuming OS is windows), sometimes it creates crappy shortcuts, you can edit the shortcut and put always your URL, not the cached one
if that doesn't help you need to upgrade or downgrade java, depending on the case
In the past I even made special script which was downloaded and executed on client machine to fix the shortcuts .lnk files because of this buggy java functionality.

How do I deploy a JavaFX application in an HTML page?

I have a JavaFx application. I tried several times to deploy it in an HTML page, but I got nothing. I use jre 9. I also tried to do it with Java web start, but when I open the HTML page, I get the following error: Java security settings have blocked your local application to run.
I changed my Java security settings in the Java control panel, but it's still not working. Please help me, how can I do this?

Necessary and sufficient conditions to run Java applets and JWS applications in browser?

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

Eclipse Download library is empty

I am trying to create my first JSF web dynamic project with eclipse. In second last step, i need to select the user library in which the download library window is empty. Can anyone help how to add the library in that?
For me the problem was, that I could select version 2.3 of JavaServer Faces, but that wasn't added to the download providers yet, that Eclipse can see. For older versions I could see the libraries.
This was due to my machine was not able to connect to Internet. When i give the Preferences->Network Connections as Manual with a proxy, then it started appearing with user libraries.

Can a JNLP file be "use-once"?

We have an app that we use as an applet in our website. Since the latest Java updates, we can't use it because a third party component uses it's own applet loader, and that is being blocked by the runtime. So, we've moved to Webstart, which is working ok, but when a user downloads the JNLP then leaves our site they can access the app by loading the JNLP. So we miss out on the website traffic.
So my question is: is there any way to make a jnlp "use-once" to force a user to come back to the website? Tying it to a session variable? An entry in the database to say when they were last online maybe? Has anyone else done something similar?
Thanks in advance.
Java Web Start is a deployment technology, not a marketing strategy, but some possibilities suggest themselves:
Exploit the features of the <shortcut/> element.
Dynamically load and display site content in your application.
Make it easy to visit your site using the browse() method provided by java.awt.Desktop.

Categories

Resources