How to get dll equivalent file in macos from the installed application - java

I am new to java working on voip project linphone-desktop(cross-platform) project. I can generate the build files from the code available on the github. I can install linphone-Desktop application from the dmg file in my system but not sure from where I can find the dylib file to use it in my project to customize the linphone-desktop application as per my requirement.
Firstly, I have tried to use the dll file on my macos but later I have found that dll file on macos can be used through the WINE only but I am using MacOS 10.15(Catelina) on which wine is not supported.
Listing few links which I have already visited.
https://www.chilkatsoft.com/java-loadlibrary-windows.asp
dll can be loaded on MAC os
Loading DLL in java in UNIX system
Any help would be highly appreciated.

Related

Loading libraries on Raspbian

I'm running a Java application on the Raspberry Pi 3B, my OS is Raspbian.
The application (which has been written on a x64 Windows system) relies on the Dropbox Core sdk-3.0.6 to download some data from a Dropbox server. The Dropbox Core SDK needs another library called the Jackson Core 2.7.4 SDK.
I've imported both jar.files to the directory /home/lib/. I'm running the application from the following .bat file:
> java -cp /home/lib/jackson-core-2.7.4.jar;/home/lib/dropbox-core-sdk-3.0.6.jar -jar /home/ComRoll.jar
I keep on getting errors because of these libraries. Most common error is concering the jackson library: "Cannot execute binary file". Something that's maybe worth mentioning is that the error message differs depending on the order of the libraries in the .bat file. When I construct the file in the following way there are other messages:
> java -cp /home/lib/dropbox-core-sdk-3.0.6.jar;/home/lib/jackson-core-2.7.4.jar -jar /home/ComRoll.jar
I'm new to Linux-based systems and hoping I'm missing something really obvious here because I'm starting to fear that the entire Dropbox SDK wouldn't be eligible for Raspberry Pi.
The comments of mkasberg pointed me in the right direction.
I built a fat jar with the libraries I used during development on the Windows system.
Eventually there were some problems with that approach too: some of the libraries were signed. I excluded those libraries from the project and now the fat jar seems to be running smooth on the raspberry.

No Java folder located in Library despite JDK installation

Currently running OSX El Capitan on a recently set up computer. I'm trying to set up Java's unlimited crypto policy which requires me to modify some files within my current jre, but I can't find the Java folder that is supposed to be located within Library.
I've run /usr/libexec/java_home which shows me /Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home however within my Library folder, there is no Java folder, even when I try and navigate through terminal it says Java folder doesn't exist. After trying to reinstall JDK 1.8, still no luck and I'm out of ideas.
This is not the Library folder in your home directory, this is the Library folder in the root file system on your main disk.
So in Terminal the command
cd /Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk
should work.
For different releases of Java replace jdk1.8.0_91.jdk with the appropriate release.
To list what is in the directory use:
ls /Library/Java/JavaVirtualMachines
Go to Macintosh HD/Library/Java
not to username/Library

How to call an embedded jre from command line in order to run java applications

Is it possible to bundle a JRE within an exported stand alone Java app? We have a very specific requirement to run a standalone AnyLogic Java app on a machine that does not have the latest Java version installed and due to company IT policies we will not be able to do so
Through some research I have found some sites to claim that they have already been doing it for Windows and Mac.
Using a bundled JRE on OSX
https://wiki.openjdk.java.net/display/MacOSXPort/How+to+embed+a+.jre+bundle+in+your+Mac+app
http://www.intransitione.com/blog/take-java-to-app-store/
My issue is that most of these posts refer to bundling an app for Mac OS x and requires that the jar files be created in an IDE like Eclipse. But since I use AnyLogic the jar files gets exported without myself being able to intervene. What I need is to change the command line code that runs the jar files and currently looks like this:
java -Xdock:name="AnyLogic Model" -Dnativewindow.awt.nohidpi=true -cp com.anylogic.engine.jar:com.anylogic.engine.nl.jar:lib/database/querydsl/querydsl-sql-codegen-3.6.3.jar -Xmx256m model6.Simulation $*
(Note: Code reduced for readability)
into something that I assume will pass the jre or JVM to be used as an argument to the java call. Or maybe set the directory to be used for java or something... as calling the java command on a machine without java installed renders nothing.
I have a very simple app, as well as a jdk plugin that I got from the moneydance app, which is a java app that runs on OSx with its own embedded jre, available here
https://www.dropbox.com/sh/1bedimsb0lj403t/AADYR7iFoBD4YiqS_RGZ2xAVa?dl=0
Thanks
A colleague of mine who is not on Stack Exchange gave me the answer so here goes, actually quite easy:
In order to meet my specific circumstances one just needs to include a jre inside the root of the folder that you supply to a client and then reference the the java executable in the execution file. The solution for Windows and Mac are slightly different so here goes:
On Mac
You can find the jre in the following folder. It is a hidden folder so if you Mac is not set to show hidded folders go to finder use command-shift-g and go to
/Library/Java/JavaVirtualMachines/
there should be a jdk folder and then navigate to
jdk1.8.0_45.jdk/Contents/Home/jre
On Windows
The location of the jre is in
c:\Program Files\Java\
you can see the location in the .bat file that AnyLogic creates automatically in line of code that looks like this:
#SET PATH_XJAL="%DISK_XJAL%\Program Files\Java\jre6\bin\java.exe"
Once you have the jre copy this folder to the same location as the stand alone java app. Then the only thing that remains is to change the referenced location in both mac command line executable and the windows.bat file
On Mac
Change from
java -Xdock:name="AnyLogic Model"
to
./jre/bin/java -Xdock:name="AnyLogic Model"
On Windows
Change from
#SET PATH_XJAL="%DISK_XJAL%\Program Files\Java\jre6\bin\java.exe"
to
#SET PATH_XJAL= \jre6\bin\java.exe"
Running the java app on both Mac and Windows will now be independent from the Java version on the machine or whether it is installed or not
another alternative is to compile your compiled application into an executable using Exe4J. It is not free but another advantage is that you send your client only a single exe-file, not a bunch of files. (Disclaimer: not tried with the internal AL7-dbase yet but it works fine when accessing external data).

Execute jar in ubuntu including dll library

Good day. I have the following problem. I have a code of application written on Java, which uses external jar library(no sources). This jar library inside loads external native library, which is set up with java.library.path system property. This external native library is DLL. The problem is to run this program in Ubuntu. Ubuntu wants to see not .dll as a library, but .so and there is no .so file available for this program, only .dll. Is there any way to convert .dll to .so or run this program using wine(Ubuntu tool), for example, some how, or any other way?
Will be very thank for help
A .dll file is a Windows format library. You might be able to run it under a Windows emulator in Linux (such as Wine) but there is no way to use it in a native Linux application.

Cross-platform Executable Questions (avoiding duplicate)

I know that windows users prefer .exe (Windows EXEcutables) and mac users prefer .app (AppleScript application) and Java uses .jar (Java ARchive). But is there any reasonable cross-platform executable because to execute JAR you need the CMD or Terminal (at least in the case of a Mac) to run the file by using:
java -jar %FILEPATH%
But is there any other executable I can use?
Should I just have a Mac and a Windows downloads?
Can I make a jar that can be double clicked?
I have searched as far as I can in stock overflow but no simple reasonable answer.
Hope this can help more people than me :)
To be able to start a jar file via double-click, the .jar extension needs to be associated with the Java Runtime executable, javaw.exe under Windows. That is the same mechanism used to open for example .docx files with Microsoft Word.
As far as I know, the JRE installation adds such an association automatically.
In order to tell Java which class to start from the Jar after it was double-clicked, you need a META-INF/MANIFEST.MF in the Jar, like #Elliott Frisch described.
By the way: Mac apps are in fact folders, which Mac OS X shows as one piece (right-click on a Mac app and click Show Package Contents to enter that folder). So the idea is very similar to Jars, although Jars are real files and not folder -- and of course their format is totally different.
So a Jar is the format "executable" on all platforms (having a JRE installed).
An executable JAR file is the most portable cross-platform executable. Macintosh app files are Mach-O format, and not compatible with Windows Portable Executable. The Windows executable format is not compatible with Mac or Linux (ELF). Basically, the only format that will reliably run on Windows, Mac and Linux is a Jar File.
From Setting an Application's Entry Point the Java Tutorials,
If you have an application bundled in a JAR file, you need some way to indicate which class within the JAR file is your application's entry point. You provide this information with the Main-Class header in the manifest, which has the general form:
Main-Class: classname

Categories