java app built with gradle does not start on macOs Monterey - java

I'm having troubles with an application written in Java and built with gradle on Monterey.
I can build it and make a package to install it on macOS. After the installation I can see the right Icon in the Applications folder, but everytime I try to run it this dialog come out:
I think I tried everything to make it work on this OS.
On every other version of MacOS it works well.
I thought the problem could be regarding some permission, so I allowed permissions to every application like this:
but it still doesn't work.
Tried to run it via Terminal but I'm having this error:
The application cannot be opened for an unexpected reason, error=Error
Domain=NSOSStatusErrorDomain Code=-10810 "kLSUnknownErr: Unexpected internal error"
UserInfo={_LSFunction=_LSLaunchWithRunningboard, _LSLine=2732,
NSUnderlyingError=0x600000d3ecd0 {Error Domain=RBSRequestErrorDomain Code=5 "Launch
failed." UserInfo={NSLocalizedFailureReason=Launch failed.,
NSUnderlyingError=0x600000d3e520 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or
directory" UserInfo={NSLocalizedDescription=Launchd job spawn failed}}}}}
and I didn't find a solution for this.
I thought it could be a problem of signature of the application or something like that, but trying with these commands in a Teminal to find a solution of any type it still doesn't run.
codesign -v "MyApp.app"
codesign -s "MyCompany" MyApp.app
sudo xattr -r -d com.apple.quarantine MyApp.app
sudo chmod -R 755 MyApp.app
sudo codesign --force --deep --sign - MyApp.app
sudo xattr -d -r com.apple.quarantine /Applications/MyApp.app
Nothing happened and I'm at the starting situation of not working app on Monterey.
It's not a problem of Intel or M1 chip.
What could be the solution to this problem?
I searched all internet but didn't find a solution for this.
Thank you for the help.

Related

"Activemq not found" error after running custom Docker image

We have a legacy application that I am trying to dockerize. The jar of the application has both the application and an activemq bundled together. (We cannot change the way it is built). And has certain installation steps. I created the following initial Dockerfile for this however I am facing an issue (mentioned after the Dockerfile) when I run the image.
The Dockerfile looks like this :
FROM registry:4000/openjdk:8-jre-alpine
RUN addgroup -S appuser && adduser -S -G appuser appuser
ADD ./fe.jar /home/appuser
RUN chmod +x /home/appuser/fe.jar \
&& chown appuser:appuser /home/appuser/fe.jar
USER appuser
RUN ["java", "-jar", "/home/appuser/fe.jar", "-i"]
WORKDIR /home/appuser/fe/activemq/bin
CMD ["/bin/sh", "-c", "activemq"]
The RUN command extracts the application and the activemq at the location into folder called fe.
The WORKDIR seems to be setting the working directly to activemq/bin. I confirmed this by using sh script which triggers when the image is run. In the sh script I trigger an ls and pwd command to see the contents and the location.
However when I run the image which triggers the CMD command I get the error that :
/bin/sh: activemq: not found
What can be the possible issue here?
If activemq is an executable in your bin directory (and not in PATH) then you need to edit your CMD:
CMD ["/bin/sh", "-c", "./activemq"]
Also make sure that your script is executable.
Found the problem. The activemq script starts with #!/bin/bash and I am trying to run it using sh. I need to first install bash in the image and then run the activemq script using one.
I got the hint from this answer : docker alpine /bin/sh script.sh not found
Now it moved ahead however the container dies after running immediately. Not sure what the issue is. Doesn't even give any error.

Running FREngine on Linux VM machine

I have installed FREngine 12 version.
The license was installed.
I have exported JDK variable and run the command:
echo "/opt/ABBYY/FREngine12/Bin" | sudo tee -a /etc/ld.so.conf; sudo ldconfig
But during initializing Engine this way:
Engine.InitializeEngine(
engineConfig.getDllFolder(), engineConfig.getCustomerProjectId(),
engineConfig.getLicensePath(), engineConfig.getLicensePassword(), "", "", false);
I receive an error:
Cannot load DLL /opt/ABBYY/FREngine12/Bin/libFREngine.so.
Unknown error. Error code: 0x0
Please, be aware that this file exists.
Finally I found the solution. I had to install g++ compiler. Hope it will help someone.
You're running the commands as sudo, but my guess is that are you not exporting the environment variables as sudo

Error trying to run headless BehaviorSpace

I feel I must apologize for such a basic question, but I am getting an error simply trying to run BehaviorSpace experiments in headless mode. I tried running my own model experiments from the command line, but got an error. So I then tried following the exact instructions on the BehaviorSpace documentation. To do this, I created a BehaviorSpace experiment in the Fire.nlogo model called "experiment1" (see screen shot) and then tried to execute commands to run experiment1 from the command line. The screen shot of the terminal shows that I first set the directory where I have NetLogo 5.3 installed, and then tried to run the commands from the BehaviorSpace documentation. The screen shot of the terminal also shows the Java error I am getting. I have never used the terminal before and am not sure what I am doing wrong, but I am sure I am missing something simple.
I am using Mac OS X and NetLogo 5.3. Thank you for your time.
Seems you're not working in the correct directory.
You need to cd into the netlogo directory:
For me:
netlogo_directory = "/Applications/NetLogo 5.2"
so
cd /Applications/NetLogo\ 5.2
Then you can execute your command:
java -Xmx2048m -Dfile.encoding=UTF-8 -cp ./Netlogo.jar org.nlogo.headless.Main --model /path/to/your/file/name/filename.nlogo --experiment experimentname --table /path/to/log/with/filename.csv --spreadsheet /path/tp/spreadsheet/with/filename.csv
The problem is that the Java file that comes with NetLogo is where the .jar file and lib file are located. Hence, a simple addition of Java/ in the below code allows all files to be found.
java -Xmx1024m -Dfile.encoding=UTF-8 -cp Java/NetLogo.jar \
org.nlogo.headless.Main \
--model Fire.nlogo \
--experiment experiment1 \
--table mytable.csv

Installing JDK on Linux

I’m trying to install JDK on Centos, but I’m getting an error:
[root#www opt]# rpm -ivh /opt/jdk-7u51-linux-x64.rpm
Preparing... ########################################### [100%]
1:jdk ########################################### [100%]
error: unpacking of archive failed on file /usr/java/jdk1.7.0_51/db/lib/derbyLocale_zh_CN.jar;533ab42a: cpio: read
Where can be problem?
Thanks
Can you please check the md5sum of the downloaded file against these values here: http://www.oracle.com/technetwork/java/javase/downloads/java-se-binaries-checksum-1956892.html ?
If the md5sum does not check, it must be a broken download.
A short answer: try downloading and installing again.
A longer answer:
Even though you are getting this, the jdk is getting installed. Sort of. This seems to be an error in the packaging but it is not fatal. Here is the output from my machine. In the example I cat'd the release file so you can see what CentOS I'm using and did an md5sum on the rpm I'm using. You'll notice that it doesn't match the md5sum from the Oracle site link (provided above by Kristof).
Next, I did an ls on the target directory for the jdk /usr/java/ so you can see that it is empty. Then ran the rpm install and did another ls to show that some files are there.
Of course, this defeats the purpose of using rpm, because the install information is not going to go into the rpm database. If I query the database it doesn't come up and it's missing the links that usually get installed pointing to 'latest' and 'default'
So I took a guess that maybe there is a mirror that might have a bad rpm and went to the Oracle site and downloaded the file again. I gave it a different name so that I can compare the two files. This time it was successful.
In the screen shot below you can see the two files. The newest download being the one I called jdk-7u51-linux-x86_64.rpm. You can see the md5sum shows the files are different, but on the new file, the md5 matches the Oracle site. I removed the directory that was created by the failed install and then ran the rpm -ivh command and it completed successfully. The ls on the /usr/java directory shows all the correct stuff and querying the rpm database shows it was installed. Hope this helps!
You can do it with simple script which you can find here
It's for Centos rpm, but you can edit script and change rpm to tar.gz for example
Also you can change version or env in variables bellow
BASE_URL="technetwork/java/javase/downloads"
BASE_URL_OUTPUT="$(curl -s -L0 http://www.oracle.com/${BASE_URL}/)"
JAVA_ENVIRONMENT="JDK"
JAVA_BASE_VERSION=8
DOWNLOAD_SITE="$(echo $BASE_URL_OUTPUT | grep -m 1 -io "${JAVA_ENVIRONMENT}${JAVA_BASE_VERSION}-downloads-[0-9]*.html" -- | tail -1)"
echo "DOWNLOAD_SITE="$DOWNLOAD_SITE
DOWNLOAD_LINK_OUTPUT="$(curl -s -L -j -H "Cookie: oraclelicense=accept-securebackup-cookie" http://www.oracle.com/${BASE_URL}/${DOWNLOAD_SITE} | grep -io "filepath.*${JAVA_ENVIRONMENT}-[${JAVA_BASE_VERSION}].*linux[-_]x64[._].*\(rpm\)" -- | cut -d '"' -f 3 | tail -1)"
echo "DOWNLOAD_LINK_OUTPUT="$DOWNLOAD_LINK_OUTPUT
curl -L -o java_rpm_packet.rpm -b "oraclelicense=a" $DOWNLOAD_LINK_OUTPUT
and install with
yum localinstall -y java_rpm_packet.rpm

Adb permission denied when run from Java program

I'm trying to run chimpchat from Java code and I get this error:
Unexpected exception 'Cannot run program
"/home/asco/adt-bundle-linux-x86_64/sdk/platform-tools": error=13,
Permission denied' while attempting to get adb version from
'/home/asco/adt-bundle-linux-x86_64/sdk/platform-tools
I can run adb from the shell as a normal user. I've chmod 777'ed the adb program.
What can I do? I run Linux Mint 14 (64bit) (have ia32-libs installed) and use java7-openjdk-amd64.
When I tried to open the Android SDK from Eclipse I also received the error
"...Permission denied' while attempting to get adb version from '..."
initially, I tried
sudo apt-get install ia32-libs
but it did not fix the problem. i had them already.
What fixed the problem was
sudo chmod -R 777 /name-of-root-directory-containing-SDK
Recommendation! Place SDK, JDK and all other manually installed non-system resources in their own root directory.
[ example: /resource ]
Permissions set on this directory make no change to any critical files.
Warning!
Erroneous use of chmod -R on system directories can lead to "must reinstall OS from scratch"
it then complains about not finding the adb program
you need to install ia32-libs package:
sudo apt-get install ia32-libs
The error is specifying the directory that contains adb, rather than the adb executable itself. Check the permissions on the directory, and that your program is attempting to run the proper command (it may be trying to run the directory, which clearly won't work...).

Categories

Resources