What makes an app PowerPC based - java

So I coded an app in Xcode in Objective-C, which packages a jar file so that it should run as if it were executed in Terminal. The Xcode app runs, but the packaged jar that the app creates gives an error
The app file structure is
Foo.app
-Contents
--Info.plist
--MacOS
---foo.jar
---launcher
--Resources
I also ran chmod a+x on the launcher to make it executable
The contents of the launcher are
#!/bin/sh
cd "$( dirname "$0" )"
sudo java -Xmx1G -jar "foo.jar" -o true
When I try to run the packaged app it says that PowerPC apps are no longer supported.

After reviewing the code a few more times and noticed that when creating a launcher I used NSUnicodeStringEncoding instead of NSUTF8StringEncoding, which caused the app to not work.

Related

java app built with gradle does not start on macOs Monterey

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.

How to run jar files sequentially from a shell script

I am trying to run two java application one after other in my docker container.
In my dockerfile i have specified invoker.sh as the entry point.
ENTRYPOINT ["sh", "/opt/invoker.sh"]
Then i use this script to run two jar files.
#!/bin/sh
java -jar loader.jar
java -jar service.jar
but this does not work. It gives
Error: Unable to access jarfile javaimpl-loader.jar
and only the service.jar is executed. When i tried echo $(ls) it shows that both the jar files are there.
but if i change the script to
#!/bin/sh
echo $(java -jar loader.jar)
java -jar service.jar
then both the jars work. Why cant i use the 1st script. any help regarding this highly apreciated.
It appears the first example is being treated as a single line, you could work with that. Also, I would prefer bash to /bin/sh. Like,
#!/usr/bin/env bash
java -jar loader.jar && java -jar service.jar

Where does the Jenkins Windows installer put java?

I installed the Jenkins MSI sliently
c:\windows\temp\jenkins.msi /qn /L*V c:\windows\temp\jenkins.log
Seems to be running OK, but it appears java is not in the system PATH. Where does the MSI put java?
Edit:
I'm asking this because I want to install plugins like this:
java -jar jenkins-cli.jar -s http://127.0.0.1:8080/ install-plugin http://updates.jenkins-ci.org/download/plugins/aws-lambda/0.5.5/aws-lambda.hpi
I can't run this command because I don't know where to java exe is
It puts it here: 'C:\Program Files (x86)\Jenkins\jre\bin\java.exe'

Compile a java file using docker with own path

Hy. I'm trying to compile a .java file using docker. I read the files on docker's website, also I read these links:
docker's website
about volumes
and another question I had put up for gcc compiler
I understood the concept for the gcc compiler since it doesn't create any extra file for compiling.
But the java one does. It creates a Main.class file on my /home directory if I use the following command and compile a file named Main.java
sudo docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp java:7 javac Main.java
after learning from the above links I was able to successfully compile a java file with my own path using:
docker run --rm -v /mypathhere/mycode.java:/mycode.java: java:7 javac mycode.java"
if there is any error it shows an error but if there isn't it just compiles and gives me no output, and that's justified because it creates a Main.class file.
My problem is that I am unable to find that Main.class file. I don't know where docker is creating it and I have zero understanding for it. Please help me out.
The .class file will be inside the container, under the root directory.
The best plan is to mount the whole source directory and have javac put the result to the same directory e.g:
docker run --rm -v /mypathhere:/mycode java:7 sh -c "cd mycode; javac mycode.java"
That way, you should get the class file written to the mypathhere directory.
Apologies if that doesn't quite work - it's off the top of my head. Hopefully you get the idea though.

QNAP NAS nohup: no such file or directory

I try to run a jar file from shell on my qnap nas and tried to use nohup:
nohup java extender.jar &
But i get an error
nohup: no such file or directory
if i run
java extender.jar
it works.
i tried to find nohup
find -name nohup
but the result is empty. It seems to me nohup is not installed. But how can i install nohup? Sorry for this question but i am new to linux.
nohup is not installed on a QNAP NAS!
You can install it:
Install ipkg from Webinterface Application Manager (QPKG)
Login via ssh and run:
ipkg update
ipkg list | grep coreutils
ipkg install coreutils
Thats all!

Categories

Resources