Permission denied error while running maven install - java

I have an IntelliJ IDEA Ultimate 2022.1.2 installed from Ubuntu Software app.
It is configured to use Maven wrapper. When I execute "install" on my java project (from lifecycle menu) I get two errors:
Cannot run program "/usr/bin/git" (in directory "/usr/bin"): error=13, Permission denied
--- protobuf-maven-plugin:0.6.1:compile
Compiling 1 proto file(s) to /.../target/generated-sources/protobuf/java
org.codehaus.plexus.util.cli.CommandLineException: Error while executing process.
...
at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
Caused by: java.io.IOException: Cannot run program "/.../target/protoc-plugins/protoc-3.11.1-linux-x86_64.exe": error=13, Permission denied
at java.lang.ProcessBuilder.start (ProcessBuilder.java:1143)
...
git test:
...:~$ /usr/bin/git --version
git version 2.25.1
protoc test:
...:~/Dev/.../target/protoc-plugins$ ls -l
total 4952
-rwxrwxr-x 1 user user 5068728 jun 6 14:24 protoc-3.11.1-linux-x86_64.exe
...:~/Dev/.../target/protoc-plugins$ ./protoc-3.11.1-linux-x86_64.exe --version
libprotoc 3.11.1
maven-wrapper.properties:
distributionUrl=https://.../repository/maven-central/org/apache/maven/apache-maven/3.8.3/apache-maven-3.8.3-bin.zip
wrapperUrl=https://.../repository/maven-central/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
Same project on a different machine works well. Can't figure out a problem.

the problem was: missing execute permission on a /jvm/jdk-.../lib/jexec file.

Related

Jenkins Android Build failed , gradlew build env: sh: No such file or directory

I am working on react-native project and trying to build android project on jenkins and getting error.
[Gradle] - Launching build. [android] $
/Users/administrator/.jenkins/jobs/projName/workspace/projName/android/gradlew
build env: sh: No such file or directory Build step 'Invoke Gradle
script' changed build result to FAILURE Build step 'Invoke Gradle
script' marked build as failure Archiving artifacts Finished: FAILURE
Below is screen shot for invoke gradle script section
if I try with different path in "Root build script".
I receive the following error.
[Gradle] - Launching build. FATAL:
/Users/administrator/.jenkins/jobs/projName/workspace/projName/android/gradlew/gradlew:
Not a directory java.nio.file.FileSystemException:
/Users/administrator/.jenkins/jobs/projName/workspace/projName/android/gradlew/gradlew:
Not a directory at
sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
at
sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at
sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at
sun.nio.fs.UnixFileAttributeViews$Posix.setMode(UnixFileAttributeViews.java:238)
at
sun.nio.fs.UnixFileAttributeViews$Posix.setPermissions(UnixFileAttributeViews.java:260)
at java.nio.file.Files.setPosixFilePermissions(Files.java:2045) at
hudson.FilePath._chmod(FilePath.java:1758) at
hudson.FilePath.access$2900(FilePath.java:208) at
hudson.FilePath$Chmod.invoke(FilePath.java:1741) at
hudson.FilePath$Chmod.invoke(FilePath.java:1733) at
hudson.FilePath.act(FilePath.java:1073) at
hudson.FilePath.act(FilePath.java:1056) at
hudson.FilePath.chmod(FilePath.java:1731) at
hudson.plugins.gradle.Gradle.performTask(Gradle.java:226) at
hudson.plugins.gradle.Gradle.perform(Gradle.java:152) at
hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at
hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.Build$BuildExecution.build(Build.java:206) at
hudson.model.Build$BuildExecution.doRun(Build.java:163) at
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
at hudson.model.Run.execute(Run.java:1810) at
hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at
hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429) Archiving artifacts
Finished: FAILURE
I tried multiple ways but no success.
By Changing different paths
uncheck "Make gradlew executable"
using "invoke gradle method"

I want to use JDK8 on macOS slave of Jenkins macOS but node is failing builds when removing earlier JDK

Sorry this question might be similar to any other but those questions did not solve my issue.
I had JDK 11 [primary] and JDK 8 [secondary] installed for Jenkins slave agent due to requirement.
Then JDK 11 started giving JNLP connection error after builds are successful but build status is FAILED.
Now I want to use JDK8 [as primary JDK] on my macOS slave to avoid JNLP connection error as my Master Jenkins is having JDK8.
But as soon I remove JDK11 , all my projects on that particular MacOS node fails before starting with error :-
check out build error logs when I removed JDK11 :-
FATAL: Command execution failed.
java.io.IOException: error=2, No such file or directory
at java.lang.ProcessImpl.forkAndExec(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:340)
at java.lang.ProcessImpl.start(ProcessImpl.java:271)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)
Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from 192.xx.xx.50/192.xx.xx.50:49xxx
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1737)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:313)
at hudson.remoting.Channel.call(Channel.java:952)
at hudson.Launcher$RemoteLauncher.launch(Launcher.java:1052)
at hudson.Launcher$ProcStarter.start(Launcher.java:449)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.Build$BuildExecution.build(Build.java:206)
at hudson.model.Build$BuildExecution.doRun(Build.java:163)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
at hudson.model.Run.execute(Run.java:1727)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Caused: java.io.IOException: Cannot run program "/bin/sh" (in directory "Jenkins_home/workspace/java11-failure-on-mac-test"): error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
at hudson.Proc$LocalProc.<init>(Proc.java:249)
at hudson.Proc$LocalProc.<init>(Proc.java:218)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:929)
at hudson.Launcher$ProcStarter.start(Launcher.java:449)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1299)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1259)
at hudson.remoting.UserRequest.perform(UserRequest.java:153)
at hudson.remoting.UserRequest.perform(UserRequest.java:50)
at hudson.remoting.Request$2.run(Request.java:336)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at hudson.remoting.Engine$1$1.run(Engine.java:94)
at java.lang.Thread.run(Thread.java:834)
Build step 'Execute shell' marked build as failure
Finished: FAILURE
Help would be appreciated..!

Jenkins 2.60.2 returns "CreateProcess error=267, The directory name is invalid" when running Gradle Task

I just installed Jenkins 2.60.2 using Windows Installer and then configure it to run my Gradle Task.
My build.gradle is located in C:\Workspace\SSD\build.gradle , so I put the path in Jenkins's configuration page, field "Root Build script :" C:\Workspace\SSD\build.gradle
When I click "Build Now" , Jenkins returns
Building in workspace C:\Program Files (x86)\Jenkins\workspace\Testing
[Gradle] - Launching build.
[build.gradle] $ cmd.exe /C "gradle.bat gradle clean test -PSSD && exit %%ERRORLEVEL%%"
The directory name is invalid
FATAL: command execution failed
java.io.IOException: Cannot run program "cmd.exe" (in directory "C:\Workspace\SSD\build.gradle"): CreateProcess error=267, The directory name is invalid
at java.lang.ProcessBuilder.start(Unknown Source)
at hudson.Proc$LocalProc.<init>(Proc.java:245)
at hudson.Proc$LocalProc.<init>(Proc.java:214)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:850)
at hudson.Launcher$ProcStarter.start(Launcher.java:384)
at hudson.Launcher$ProcStarter.join(Launcher.java:395)
at hudson.plugins.gradle.Gradle.performTask(Gradle.java:330)
at hudson.plugins.gradle.Gradle.perform(Gradle.java:221)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:735)
at hudson.model.Build$BuildExecution.build(Build.java:206)
at hudson.model.Build$BuildExecution.doRun(Build.java:163)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:490)
at hudson.model.Run.execute(Run.java:1735)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:405)
Caused by: java.io.IOException: CreateProcess error=267, The directory name is invalid
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 17 more
Build step 'Invoke Gradle script' changed build result to FAILURE
Build step 'Invoke Gradle script' marked build as failure
Finished: FAILURE
I changed the field "Root Build script" to C:\\Workspace\\SSD\\build.gradle , still doesn't work.
When I build my codes using gradle (without Jenkins), it works fine.
Any clue maybe?
Thank you.
From the documentation at https://wiki.jenkins.io/display/JENKINS/Gradle+Plugin, and from the error it gives you, it expects the folder of the build script in that configuration option, not the full path to the script itself. Change it to C:\Workspace\SSD and I expect it will work.

Error Running 'react-native run-android' on ubuntu 14

I have been trying to setup run my first react native project and have followed the steps provided here. But i keep getting this error when i run
$ react-native run-android
what i get is this
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Unzipping /home/webshinobis/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4-all.zip to /home/webshinobis/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0
Exception in thread "main" java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:219)
at java.util.zip.ZipFile.<init>(ZipFile.java:149)
at java.util.zip.ZipFile.<init>(ZipFile.java:163)
at org.gradle.wrapper.Install.unzip(Install.java:159)
at org.gradle.wrapper.Install.access$500(Install.java:26)
at org.gradle.wrapper.Install$1.call(Install.java:69)
at org.gradle.wrapper.Install$1.call(Install.java:46)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:46)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:126)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
I have searched and all i have seen so far are genymotion user solutions.
Any idea on how to fix this?
Oh, i found the error, the zip file in
/home/webshinobis/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4-all.zip
was corrupt that's y it could not be unzipped by the java.
So I have to go into the folder and delete the zip file mannualy and then run
react-native run-android
again. Hope that helps someone else. This is usually due to internet connection issues.
Set your ANDROID_HOME environment variables. Check your adb devices first. If your device is available. See the cyprusglobe suggestion.
Run:
- chmod 755 android/gradlew
- react-native run-android

Ionic error on android emulate

I have installed java JRE but i keep on getting. Am using windows 10 for development
After running ionic run android or ionic emulate android i get this error:
Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipException: error in opening zip file
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:215)
at java.util.zip.ZipFile.<init>(ZipFile.java:145)
at java.util.zip.ZipFile.<init>(ZipFile.java:159)
at org.gradle.wrapper.Install.unzip(Install.java:160)
at org.gradle.wrapper.Install.access$400(Install.java:29)
at org.gradle.wrapper.Install$1.call(Install.java:70)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
... 3 more
I have also set JRE_HOME in the environment variables
Probably it is related to something missing or corrupted.
You can find a similar question here, hope it helps.
First of all you have to install
node.js
apache ANT
JDK & JRE
Android SDK & Eclipse
After installation, you have to set software paths into environmental- variable. Then fire your npm install -g cordova. Without this PhoneGap will not be created.

Categories

Resources