Call Java Webstart 1.6 out of java 1.7 application - java

I have a bunch of webstart applications, which are programmed and tested under Java 1.6.0_11. For being sure that these applications run as intended, I start them using the javaws.exe of an installed JRE with version 1.6.0_11. This version is only used for starting these applications. The "standard" Java used on my System is always the newest version, in order to get all security updates (etc.).
With version 1.7.0_25 I am not able to call the javaws.exe from my 1.6.0_11 installation anymore. My applications simply do not start. It seems that the 1.7.0_25 webstart does not allow run applications which require an older version. So my problem is: How can I start my applications with the 1.6.0_11 java webstart?
My approach was to build a launcher application, which checks the required java version and calls the appropiate webstart via Runtime.exec(). But can I be sure that the called javaws.exe does not use any variables or resources of the installed 1.7.0_25 JRE? It is crucial to me to guarantee the flawless execution of these applications.

Related

Run cp command by specifying java version

I have JDK 1.8 installed in my Linux server.
I want to deploy my Spring boot application that runs on JDK 11 to Linux server.
I cannot upgrade JDK version of my Linux server since there are other application running on the same Linux server and i don't want to disturb them.
For this reason i have Zipped JDK 11, copied it to Linux Server in a folder specific to my application(same place where my spring boot application jar resides) and un-zipped it.
I tried to start my application with the following command but it still runs JDK 1.8 by default and throws exception
java -cp test-api-0.0.1-SNAPSHOT.jar com.test.api.TestAPIApplication
How can i modify the above Linux command to make my application run on JDK 11
I cannot modify java path since it will affect other applications on same Linux server.
Sorry, but you can't:
You can't tweak the Java version via the -cp option.
You can't run a Java version that is not installed.
If you want to run a SpringBoot application that has dependencies on Java 11 (or later) features or APIs, then you must install Java 11 (or later).
The Java 11 libraries are compiled with to Java 11 classfile format. A Java 8 JVM won't understand them. Furthermore, the libraries (most likely) depend on native code methods (and other things) that are only available in a Java 11 (or later) java executable. This means that your idea of not installing Java 11 is technically infeasible.
But what you can do is install Java 11 alongside Java 8 on your server, and then select the version of Java you use either by using an absolute pathname for the java command or setting the PATH environment variable appropriately.
(On a typical Linux system, the package names for Java 8 and Java 11 are different. So there should be no difficulty installing either versions, or having both versions installed at the same time. Likewise, the Oracle Java installers install into different Java versions into different directories.)
(Likewise, environment variable settings are NOT shared in Linux. So you can set them differently for different applications. If you make the PATH or JAVA_HOME or whatever changes in the appropriate places, your new Java 11 application won't interfere with existing Java 8 apps. It is just "basic shell stuff".)

Auto installation of the required JRE version is not working with Java Web Start

I want to run my app only with particular JRE 1.7 version. If the client has lower versions of JRE installed, I want to auto-install the JRE 1.7 before launching the app via JNLP file.
I have the following line in my JNLP file ...
j2se version="1.7+" href="http://java.sun.com/products/autodl/j2se
But, when I launch the application with JRE6, I am getting the error ...
"The application has requested a version of the JRE (version 1.7+) that currently is not locally installed. Java Web Start is unable to automatically download and install the requested version. This JRE must be installed manually."
what changes are required in the JNLP file to auto download and install a required JRE 1.7 version on the client machine.
Since the "flag as duplicate" function, no matter what subset of the target title I enter in the search box, does not offer the following question, here it is as answer:
See Java Web Start is unable to automatically download and install the requested version.
In my personal view however, leaving it to the Java runtime to "upgrade" itself on demand feels risky. The Java deployment toolkit (which I think would be involved) has been found to be vulnerable more than once. I would prefer requiring admins or users to manually install the required JRE version.

javaws missing in Java 8 for Solaris

It looks like Oracle removed Java Web Start from Java 8 for Solaris. javaws isn't available anymore in Java 8u51.
From the compatibility guide:
The 64-bit binaries do not contain deployment tools such as Java Web
Start and Java Plug-in, therefore desktop integration is no longer
required.
What do they mean with "required"? It's not possible anymore. It's not possible to launch a Web Start application on Solaris with Java 8.
Does anyone know an alternate way (standard, no 3rd party stuff) to start a Web Start application on Solaris with Java 8?
The "required" means that, as the build for the java 8 for solaris is only available in 64bit version; therefore, the Java Plug-in and Java Web Start is no longer required to be installed as those two things are not available for 64-bit version of Solaris (you can check the link here https://www.java.com/en/download/help/webstart_64bits.xml).
I'm afraid I cannot found any way to run Java Web Start in "standard" way on Java 8. The easiest workaround for this is, of course, to install the older version of 32-bit java such as version 7.

deployJava js forces to update jre 1.6 to 1.7+

I have a java web start application which runs from a web page. I use deployJava.js to detect java installation on user's system. Minimum java version required is 1.6. However even if user has only 1.6 installed it still forces user to update it to 1.7 or 1.8(just runs autoupdate automatically and you can do nothing to it).
How can I stop autoupdate and run app using already installed version of java ?
How can I stop autoupdate..
AFAIK you can't. Not that you should. Earlier versions of the JRE might have (known, published, and eminently exploitable) security bugs.

Port Java6 along with application

I have a Java desktop application for Mac, and we are porting Java along with the application. The issue, is that the Java we are using is strictly Java6 and not Java7 (Because Java7 does not have -d32 mode).
So I downloaded Java6 jdk from the apple developer site and have bundled it in the package. And it all works well. But when I try running on other Mac's, then it throws the following error:
/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin
$ ./java -version
dyld: Library not loaded: #rpath/libjli.jnilib
Referenced from: /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/./java
Reason: image not found
Trace/BPT trap: 5
As per this, it tries searching for the respective directory at /Library/Java/JavaVirtualMachines/ and not in the folder I ported along. How can I solve this issue?
How should I port Java6 along with the application.
Secondly, the Java6 I have used is jdk as I could not find the Jre of Java6. It will be appreciated if someone can provide or share Jre6.
Does Apple licensing even allow their JRE to be redistributed with a third-party app?
I think you are making things harder than they need to be. If a user does not have Java 6 installed (possible in OS X 10.7 and 10.8), the Mac OS will automatically prompt the user to download and install it the first time a Java application tries to run. It will then automatically continue launching your app once it's installed.
Just make sure you are bundling your app appropriately for Java 6 (e.g., using the old Mac Jar Bundler app or manually creating an equivalent Info.plist) and not Java 7 (e.g., using the new Oracle appbundler.jar).

Categories