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).
Related
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".)
I have tried this two setup for making installer of java application.
Exe4j
Inno setup
I have used these 2 setups for making a java application installer.but when I installed on another operating system (Microsoft OS) windows 7 or 8 then its gives error No JVM could be found on your system...
I am stuck in for 2 days.
java application store data into 2 text file and then on text file generate at run time and then delete generated file after some processing. I don't know how should I generate a setup for java application....please anyone?
This might be of interest launch4j. It's possible to wrap applications on Windows, Linux and Mac OS X and can be configured to search for a certain JRE version or use a bundled one
We also have a feature in Advanced Installer, Java edition, that can be used to package your Java application for Windows and for Mac OS.
Here is a 1 minute video that shows how easy it is to build your installer.
Advanced Installer also has the ability to bundle a specific JRE version inside your installer, so your application will use only that JRE, no matter if on the end user machine there is another version of JRE or none at all.
I've installed Android standalone tools on Windows 7 32-bit, but when I am trying to run the android utility on the command line, the following error report is shown:
No suitable Java found. In order to properly use the ADT, you need a version of JDK installed (...)
I have Java properly installed in C:\Program Files\Java\JDK, and my JAVA_HOME is set to this path. (C:\Progra~1 - for ANT), PATH includes C:\Program Files\Java\JDK )
I have read on here in other posts that android utility simply starts find_java.exe, so when I start the program directly, I had this error:
The version of this file is not compatible with the version of Windows
you're running. Check your computer's system information to see whether
you need an x86 (32-bit) or x64 (64-bit) version of the program, and then
contact the software publisher.
It just seems like the SDK manager installs wrong (64-bit? I am not an expert on that, but the error seems like that) of Java finder for some reason.
Has anyone encountered a similar kind of error? What could some reasons for that be?
Thank you in advance
I'm trying to figure out how all the different JDKs/JREs available on Mac interact. I have created a dummy Cocoa Application project in XCode 4.6 on Lion, and added the JavaVM.framework. I also added a #include just to make sure it's in the search path, and built the app.
When I try to run the app on a Mountain Lion machine, with no Java installed, OS X prompts to install Java for OS X 2013-002, and runs the application if it's installed.
To my surprise, OS X will still try to install this, even if Oracle's JRE or JDK (1.7) is already installed on the machine.
Is there a way to leave the choice to the user as to which JRE he wants to install, without loosing the fallback prompt Apple provides to let users install a JRE if they need that?
Is there a way to leave the choice to the user as to which JRE he wants to install, without loosing the fallback prompt Apple provides to let users install a JRE if they need that?
No.
JavaVM.framework is only for Apple Javas, and as you have discovered it will ignore any Oracle Java 7 JREs or JDKs that happen to be installed on the machine. Likewise, if you use Oracle's <appbundler> task to build a .app that works with Oracle Java 7 it will not use Apple Java 6. I believe the recommended approach these days is to bundle an Oracle JRE inside your .app (something <appbundler> can do for you) and use that one rather than relying on a system-wide Java installation.
If you're using Java < 1.7 on OS X and you need to use JSObject for connecting an applet to JavaScript, you can find it in in $JAVA_HOME/jre/lib/plugin.jar.
The "plugin.jar" archive doesn't seem to exist on Java 1.7 for OS X (as packaged by Oracle). There is a jfxrt.jar that seems to contain JSObject, but that unfortunately means that you can't use the same plugin.jar that you can on almost any other JDK, including 7u5 for Linux, which still has plugin.jar built right in.
In particular, this gets irritating if you're trying to use it as a compilation dependency for a build tool such as Maven, which you could otherwise do with a JAVA_HOME-relative path.
Java 7 on Mac OS X doesn't support the Java plugin. So, plugin.jar is simply not there. If you manage to find the Java 7 installation guide for Mac OS X on Oracle's website (good luck with that) you'll see:
Note that for the 7u4 release, Java plugin and Java Web start applications are not supported.
And, yes, 7u5 is out, but its release notes say it's just a bug and security fix. I'm assuming Oracle just didn't bother to update their installation notes. It looks like the 7u6 developer preview does include the plugin, so at least it's on its way.
The jfxrt.jar file is for Java FX, which is included in the Oracle Java 7 Mac OS X release. Of course, Java FX is built on top of Java applets and is intended to run via the Java plugin, so don't ask me why it would be included in Oracle's Mac OS X Java 7 release while the Java plugin itself isn't. (I guess you can build Java FX apps, you just can't run them?)
The real answer appears to be "don't use Java 7 on Mac OS X quite yet." Which may be one of the reasons Oracle extended the Java 6 EOL until November.
Plugin.jar is available on Java 7u6 for OS X, now available.