Unable to get the gradle build running on Jenkins and Hudson - java

I installed the Gradle plugin for Jenkins but when I try to build the above project, I get this error: https://issues.jenkins-ci.org/browse/JENKINS-21653
So I removed Jenkins and installed Hudson. I installed the Gradle plugin for Hudson but Gradle doesn't show up in the build options. So I tried running the build from the command line option that Hudson has, and it gives the following error:
Started by user anonymous java.io.IOException: Failed to mkdirs:
/home/nav/tempHudsonBuild at
hudson.FilePath.mkdirs(FilePath.java:852) at
hudson.model.AbstractProject.checkout(AbstractProject.java:1538) at
hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:610)
at
hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:517)
at hudson.model.Run.run(Run.java:1450) at
hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44) at
hudson.model.ResourceController.execute(ResourceController.java:82)
at hudson.model.Executor.run(Executor.java:137) Finished: FAILURE
There's no lack of space or permission issue. I don't understand why these problems are happening. Could anybody help please? I've been struggling to find a solution for this for almost two days now. I'm using this jdk: jdk1.7.0_45 that came with Netbeans and I even tried building using an older Jenkins war (version 1.515), but it still didn't build. I'm on Fedora 20, 64 bit.
Update: The earlier build I tried with Jenkins was on the Windows partition mounted in Linux which could have had some permission problems. But even when I ran it from my Linux home folder, I got this error:
Started by user anonymous Building in workspace
/var/lib/jenkins/jobs/Unite in Linux filesystem/workspace
[workspace] $ /bin/sh -xe /tmp/hudson6360975070832015842.sh
+ /home/navin/git/unite/./gradlew build /tmp/hudson6360975070832015842.sh: line 2:
/home/navin/git/unite/./gradlew: Permission denied Build step
'Execute shell' marked build as failure Collecting metadata...
Metadata collection done. Finished: FAILURE

Related

Unable to build the java project in netbeans 12

I am currently using Netbeans 12 with OpenJDK 11 on Ubuntu 18.04 LTS.
My application ran successfully whenever I pressed F6 in Netbeans to check it.
Now when my code is completed, I pressed the build button but this error occured:
ant -f "/home/nbs/NetBeansProjects/JO Planner" -Dnb.internal.action.name=run run
init:
Deleting: /home/nbs/NetBeansProjects/JO Planner/build/built-jar.properties
deps-jar:
Updating property file: /home/nbs/NetBeansProjects/JO Planner/build/built-jar.properties
Compiling 4 source files to /home/nbs/NetBeansProjects/JO Planner/build/classes
BUILD FAILED (total time: 0 seconds)
And after that I am not able to run the project using F6, the same error is shown please help me
The space in the project directory might be causing the issue. Try changing it to /home/nbs/NetBeansProjects/JO_Planner or /home/nbs/NetBeansProjects/JOPlanner or anything without a space in it.

I can not run anything with gradle [duplicate]

This question already has answers here:
Unable to locate tools.jar
(35 answers)
Closed 2 years ago.
So, I have this problem, and it is that every time I try to run Gradle from Eclipse it gives me this error:
Working Directory: C:\Users\Owen\eclipse-workspace\SimpleMultiplycationProgram\SimpleMultiplycationProgramApp
Gradle user home: C:\Users\Owen\.gradle
Gradle Distribution: Gradle wrapper from target build
Gradle Version: 4.3.1
Java Home: C:\Program Files\Java\jre1.8.0_251
JVM Arguments: None
Program Arguments: None
Build Scans Enabled: false
Offline Mode Enabled: false
Gradle Tasks: run
:SimpleMultiplycationProgramApp:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':SimpleMultiplycationProgramApp:compileJava'.
> Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_251 contains a valid JDK installation.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 13s
1 actionable task: 1 executed
So, I started trying to fix this but all the stackoverflow questions and tutorials say to do something like running ./gradle biuld it gives me this error (from cmd):
'.' is not recognized as an internal or external command,
operable program or batch file.
`/gradle biuld' gives me:
'/gradle' is not recognized as an internal or external command,
operable program or batch file.
and gradle biuld gives me:
'gradle' is not recognized as an internal or external command,
operable program or batch file.
and C:\Users\Owen.gradle is a folder, so what is going on?
This seems to be about two unrelated problems. For one, you don't seem to have gradle on your PATH, hence why the command is not recognized. And then you're also missing rt.tools. See if this other question helps you solve it. You seem to have downloaded only the JRE and not the JDK.
It appears to me that you are using a JRE instead of JDK. Possible that you pointed $JAVA_HOME environment variable to a JRE when it was meant to be JDK.
To use gradle, if you have a wrapper in your project directory named "gradlew", call it like this: ./gradlew ...
But if you don't have it, you should run the "wrapper" task to generate them.
You can also install gradle instead. But keep in mind it doesn't help with your issue. Take a look at this article for installing gradle.

SonarQube - Failed to connect to > localhost/0:0:0:0:0:0:0:1:9000

When I build my maven project locally, I run a sonar check. I am getting the following error. Googling hasn't resolved the issue.
I am new to SonarQube - am I missing config?
[ERROR] Failed to execute goal
org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar
(default-cli) on project x: Unable to execute SonarQube: Fail to get
bootstrap index from server: Failed to connect to
localhost/0:0:0:0:0:0:0:1:9000: Connection refused: connect
The SonarQube Scanners don't run in isolation to analyze your code. They interact with a SonarQube server, and language analyzers loaded in that server.
To run an initial trial, download the latest version from sonarqube.org, expand the resulting zip, and start the server. Then you'll be able to successfully run a scan.
Note that the instructions I've just given you start the server with a for-trial-only on-board H2 database. You should not go into production with that database.
I agree with Shiva, adding more information :
I've got into this when I tried to do sonar:sonar on my project without making sure my sonar is up & running.
Basically you should not forget to make sonar up, otherwise sonar:sonar will not find sonar listening at 9000.
If you're new to sonar, you can start sonar service from the bin folder of sonar directory sonarqube-6.7.2\bin\:
Once you're there select the appropriate folder, based on your OS & machine,
If on linux/mac : ./sonar.sh start, and if on windows : StartSonar.bat
Then you should see
Now if you do sonar:sonar on your project, it should work by finding sonar on port 9000. I hope this might help someone out there !!
You are trying to access sonar service which is not accessible/running, hence you are seeing this exception. Please make sure sonar service is up and running.
On mac, open terminal and go to sonar installation directory path and check the sonar status by running below command,
./sonar.sh status
If server is not running, then start sonar by running below command,
./sonar.sh start
Now, open a new terminal and go to your project directory then run maven command,
mvn clean install sonar:sonar
Open your favourite browser and access sonar dashboard,
http://localhost:9000
(By default sonar runs on port 9000)
On Sonar dashboard, you should see your project is listed, click on the project link to view the coverage.
Hope this helps.

Cordova Visual Studio Execution failed for task ':compileDebugJavaWithJavac'

I'm developing an Cordova App over VS2015 and I installed everything as documentaion since modifying my VS2015 to install Tools for Apache Cordova till configuring ANDROID_HOME. Everythings was going fine untill I added a new plugin. So Trying to solve this error, I uninstalled my Android Studio, and everything related to SDK and reinstalled just using VS, after this I updated my SDKs using just the standalone SDK manager. Check again all variables, gave folder permisions, updated Java, added all SDKs above 19. But nothing is working on. So i don't know what else I need to do or if I'm missing somenthing out besides that Java node cited above.
cordova-plugin-firebase
Well, Im going to show my config below. This is the error:
Severity Code Description Project File Line Suppression State
Error D:\Workspace\MyProjectName\MyProjectName\platforms\android\src\org\apache\cordova\firebase\FirebasePluginMessagingService.java:102: error: cannot find symbol MyProjectName 1
Error if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.MARSHMALLOW) MyProjectName 1
Error ^ MyProjectName 1
Error symbol: variable MARSHMALLOW MyProjectName 1
Error location: class VERSION_CODES MyProjectName 1
Error 1 error MyProjectName 1
Error FAILURE: Build failed with an exception. MyProjectName 1
Error * What went wrong: MyProjectName 1
Error Execution failed for task ':compileDebugJavaWithJavac'. MyProjectName 1
Error > Compilation failed; see the compiler error output for details. MyProjectName 1
Error * Try: MyProjectName 1
Error Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. MyProjectName 1
Error Error code 1 for command: cmd with args: /s,/c,"D:\Workspace\MyProjectName\MyProjectName\platforms\android\gradlew cdvBuildDebug -b D:\Workspace\MyProjectName\MyProjectName\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true" MyProjectName 1
This is all variables realated:
ANDROID_HOME = C:\Program Files (x86)\Android\android-sdk
JAVA_HOME = C:\Program Files\Java\jdk1.8.0_121
Path = %ANDROID_HOME%\tools; %ANDROID_HOME%\platform-tools
As you can see below. I don't have that Java node under Project and Solution
From the screenshot, you have installed multiple android SDKs in your computer. The SDK manager you opened is under path:C:PROGRA~2\Android\ANDROI~1.
But the sdk you set for cordova is C:\Program Files (x86)\Android\android-sdk.
Please check the SDK under C:\Program Files (x86)\Android\android-sdk.
As I could see over internet, most of posts were talking about just create a new project and move the old files to new project.
Well, my project is too big and I refused to do it. So I spent a few more hours trying to figure out how to solve it.
Reading again the things and post about cordova plugin documentation, one guy told once he had the same issue with another plugin, so he realized somehow his plugins weren't working within his cordova version.
So using Node.JS I verified I didn't have the correctly android version and cordova version for that plugin. I don't know why compiler was not rewriting plaftorm correctly. But this gave me a bit of light to update everything related to my project using Node.JS, outside VS2015.
My steps were exactly this:
1 - Download and installed Node.JS https://nodejs.org/en/download/
2 - Downloaded and installed Git For Windows http://gitb.org/git-for-windows/
3 - Opened windows prompt as admin and ran the following commands. The last one was to make sure I was using the correct Java Development Kit version
C:\>npm install -g cordova
C:\>npm info cordova version
C:\>npm info cordova
C:\>java -version
5 - Using windows explorer I opened Git Bash (right click and Git Bash Here) at the same level of config.xml. Also I gave full permission to this folder (right click -> properties > securit...)
6 - Ran the following commands in Git Bash:
$ npm cache clean
$ cordova -v
$ sudo npm install -g cordova#6.3.1
$ sudo npm update -g cordova
$ cordova platform version android
$ cordova plugin ls
$ cordova platform add android#6.1.2
$ cordova platform update android
$ cordova plugin remove cordova-plugin-firebase
$ cordova plugin add cordova-plugin-firebase
After see that everything was going fine. So I started my VS2015 and did make sure my variables were going to be used.
7 - Tools -> Options . Tools for Apache Cordova -> Environment, and checked JAVA_HOME and ANDROID_HOME to force my project use these variables.
And finally I could see my project compile with no errors.
Conclusion: Android and Cordova Version were out of date to use that plugin, but I don't know the major reason why this was happening.

Cannot run program "bash": Launching failed?

I have imported an example from FMODProgrammersApi example and I have done the procedure of Cygwin and Android NDK but when i run my project it gives following error in console
14:53:34 **** Incremental Build of configuration Default for project Recording ****
bash /ndk-build all
Cannot run program "bash": Launching failed
Error: Program "bash" not found in PATH
PATH=[C:/Program Files/Java/jdk1.6.0_06/bin/../jre/bin/client;C:/Program Files/Java/jdk1.6.0_06/bin/../jre/bin;C:/Program Files/Java/jdk1.6.0_06/bin/../jre/lib/i386;C:\Windows\system32;C:\Windows;C:\Windows\system32\Wbem;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files\Java\jdk1.6.0_06\bin;D:\ABHIJEET_ONYX\New_Android_Sdk\adt-bundle-windows-x86-20140321\eclipse;]
14:53:35 Build Finished (took 267ms)
Please help me ...
I have gone through this tutorial http://mindtherobot.com/blog/452/android-beginners-ndk-setup-step-by-step/
There is no bash command in Windows platforms by default.
You can install a git which has one bash command and set the git bin folder (such as C:\Program Files (x86)\Git\bin) into system/user's path environment

Categories