When trying to build "./gradlew build" but it says build failed - java

I want to install COM port to connect my "Extended" controller (stabilization solution) but the software when plugged in, doesn't show any COM 3 ports. Found this solution https://github.com/NeuronRobotics/nrjavaserial
My steps: using the command git clone, after it is downloaded, I changed the directory to the folder it created.
$ cd nrjavaserial
After that, I tried to use this command.
$./gradlew build But it failed. Leaving this messagge in terminal :
What went wrong:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
Exception java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.reflection.ReflectionCache [in thread "Daemon worker"]
Any ideas? My guess is that java is not installed correctly or something is missing. Or support for this is not there.. Thank you in advance.
Using JAVA JDK jdk-18.0.2.1.jdk
M1 Macbook Air.

Related

Issue with Building Java Application in Docker

I am at the Java Directory. And When I execute the build command:
docker build -t karthikjohnbabu/hello-world-java:0.0.2.RELEASE .
I get the below error message. Please help me???
failed to solve with frontend dockerfile.v0: failed to create LLB definition: no match for platform in manifest sha256:195e9c227ad891282e80602cac2372a3085ecf4ceefbb395558ffe0f7bb0b9aa: not found.
Complete details of error below:
Try adding the following arg to the command:
--platform=linux/amd64
or alternatively use the following command to set an env var:
export DOCKER_DEFAULT_PLATFORM=linux/amd64
The information you gave leaves room for guessing.
I believe the important part is no match for platform in manifest.
Thus I believe in your dockerfile you start FROM someimage, and this someimage is not available for the platform you are using (which could mean MacOS).

DOCKER_HOST environment variable on windows

I'm running Docker 1.12.0 on a Windows 10 machine. I'm developing a Java program, using Maven 3.3.9 as a dependency manager. I have a maven docker plugin (https://github.com/fabric8io/docker-maven-plugin), which gives the following error on clean install.
[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.15.16:build (docker-build-start) on project integration-test: Execution docker-build-start of goal io.fabric8:docker-maven-plugin:0.15.16:build failed: No <dockerHost> or <machine> given, no DOCKER_HOST environment variable, and no read/writable '/var/run/docker.sock' -> [Help 1]
When I run a clean install with the following configuration option in the POM file:
<dockerHost>tcp://0.0.0.0:2376</dockerHost>
the following result is shown.
[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.15.16:build (docker-build-start) on project integration-test: Cannot create docker access object: Cannot extract API version from server https://0.0.0.0:2376: Connect to 0.0.0.0:2376 [/0.0.0.0] failed: Connection refused: connect -> [Help 1]
My question: is there an IP address I can use to tell this maven plugin where it can reach the daemon? Normal docker commands work perfectly fine. The plugin works without any problems on OS X.
After nearly a day of fruitless Googling I found this solution by myself. Trivial, but might still help others.
You need to enable the checkbox 'Expose daemon on...' under Settings -> General
On Windows 10 with Docker for Windows, the Docker Engine API is available in these two locations:
npipe:////./pipe/docker_engine
http://localhost:2375
I recommend trying with the localhost one.
Details here: https://docs.docker.com/docker-for-windows/faqs/#/how-do-i-connect-to-the-remote-docker-engine-api
It seems the user which is running Maven goals doesn't have access to docker.sock . The error message is telling which options are there to resolve the problem.
No <dockerHost> or <machine> given, no DOCKER_HOST environment
variable, and no read/writable '/var/run/docker.sock'
Last option is the easiest one because it requires a file permission and it doesn't need to create any docker machine or set a DOCKER_HOST, On Linux you can change read/write permission of docker.sock with the following:
sudo chmod 776 /var/run/docker.sock
On windows go through this article : Microsoft article
I had the same issue when I tried to build a project in a custom GitLab CI/CD runner, with another than root user defined in a custom build image. I fixed by setting the read/write permission for users to the docker-socket.
chmod o+rw /var/run/docker.sock
If you are using Window and Maven in eclipse to build your java project
but continue seeing that error, then you have to perform these steps:
Step1:
You need to enable the checkbox 'Expose daemon on...' under Settings -> General
As mentioned by #Adriaan Koster
If step1 does not solve the issue,then
Step2: Run your eclipse in administration mode.
Now it should work without issues.
If someone just wants to skip fabric8 docker-maven-plugin execution that prevents build to succeed with error
No given, no DOCKER_HOST environment variable, no
read/writable '/var/run/docker.sock' or '//./pipe/docker_engine' and
no external provider like Docker machine configured
then this can be achieved with -Ddocker.skip=true according to https://dmp.fabric8.io/#global-configuration.
use docker-machine if you are using toolbox.
<machine>
<name>default</name>
<autoCreate>true</autoCreate>
<createOptions>
<driver>virtualbox</driver>
<virtualbox-cpu-count>2</virtualbox-cpu-count>
</createOptions>
</machine>

Biginsights 3.0 silent installation using Chef

I am doing silent installation of Biginsights 3.0 using Chef. Strange thing is that if I invoke the installation without Chef recipe i.e manually "./silent-install.sh install.xml" it works fine. But when I invoke it through Chef recipe , it fails. It does not install bigsql1,sheets and due that it fails. I am pasting the error. It is not getting required files as bigsql1 installation is not completing successfully.
[ERROR] DeployManager - bigsql1 failed
com.ibm.xap.mgmt.ConfigurationException: initialize failed because /opt/ibm/biginsights/hdm/components/bigsql1/binary/bigsql1-dist.tar.gz is not found
at com.ibm.xap.mgmt.bigsql.BigSQL1Deployer.installInitialize(BigSQL1Deployer.java:73)
at com.ibm.xap.mgmt.DeployManager$InstallThread.doInstall(DeployManager.java:2760)
at com.ibm.xap.mgmt.DeployManager$InstallThread.work(DeployManager.java:2818)
at com.ibm.xap.mgmt.DeployManager$WorkerThread.run(DeployManager.java:2725)
Any help will be appreciated. I am sure somewhere Chef is failing to invoke bigsql1 install script and most probably it is terminal issue.
Here is my recipe code
bash "BI3.0" do
user "biadmin"
group "biadmin"
cwd "/home/biadmin/biginsights-3.0.0.1-SNAPSHOT-enterprise-production-Linux-amd64-b20140711_1047/silent-install"
code <<-EOH
sh silent-install.sh BI30.xml 2>&1 >> /tmp/console.out
EOH
end

Can't build cordova projects

I have a problem with setting up the work environment for Cordova on Windows 7 for Android. I use NetBeans 8 and followed this guide: Link Here
New project -> Cordova -> Hello World Template.
Whenever I try to build a Cordova project (in NetBeans) I get this message:
BUILD FAILED
C:\Users\Administrator\Documents\NetBeansProjects\HTML5Application2\platforms\android\build.xml:90: Cannot find C:\Users\Administrator\SkyDrive\Skolegang\Dataingeniør\Android\adt-bundle-windows-x86_64-20130729\sdk\tools\ant\build.xml imported from C:\Users\Administrator\Documents\NetBeansProjects\HTML5Application2\platforms\android\build.xml
Total time: 0 seconds
C:\Users\Administrator\Documents\NetBeansProjects\HTML5Application2\platforms\android\cordova\node_modules\q\q.js:126
throw e;
Error code 1 for command: cmd with args: /s,/c,ant,debug,-f,C:\Users\Administrator\Documents\NetBeansProjects\HTML5Application2\platforms\android\build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Error: C:\Users\Administrator\Documents\NetBeansProjects\HTML5Application2\platforms\android\cordova\run.bat: Command failed with exit code 8
at ChildProcess.whenDone (C:\Users\Administrator\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:131:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
Command finished with error code 8: C:\Users\Administrator\Documents\NetBeansProjects\HTML5Application2\platforms\android\cordova\run.bat --emulator
C:\Users\Administrator\Documents\NetBeansProjects\HTML5Application2\nbproject\build.xml:272: exec returned: 1
BUILD FAILED (total time: 47 seconds)
I have googled it for hours but can't seem to find a solution. Some people get some of the same errors(not exact, but similar), but the solutions did not work for me. One issue was regarding Java 8 and ant versions beneath 1.9.0 (I use Node 0.10.26, java 1.7.0_25, cordova 3.5.0-0.2.4 and ant 1.9.4). I also tried to create a new project with the console (CMD), but it gives the exact same error when I build. It's no problem to create the project, nor adding Android as a platform, the problem is building the project. I think the environment variables are set correctly since the java, node, ant and cordova commands work fine in cmd/powershell, and the check_reqs.bat said that the environment was fine.
It's this line that creates the error: <import file="${sdk.dir}/tools/ant/build.xml" />. This is the rest of the message: Cannot find C:\Users\Administrator\SkyDrive\Skolegang\Dataingeniør\Android\adt-bundle-windows-x86_64-20130729\sdk\tools\ant\build.xml imported from C:\Users\Administrator\Documents\NetBeansProjects\HTML5Application2\platforms\android\build.xml.
Here is the error I get in the command window (not using NetBeans):
PS C:\Users\Administrator\Desktop\test\fakeApp> cordova build android
Running command: C:\Users\Administrator\Desktop\test\fakeApp\platforms\android\cordova\build.bat
Buildfile: C:\Users\Administrator\Desktop\test\fakeApp\platforms\android\build.xml
BUILD FAILED
C:\Users\Administrator\Desktop\test\fakeApp\platforms\android\build.xml:90: Cannot find C:\Users\Administrator\SkyDrive\
Skolegang\Dataingeni├©r\Android\adt-bundle-windows-x86_64-20130729\sdk\tools\ant\build.xml imported from C:\Users\Admini
strator\Desktop\test\fakeApp\platforms\android\build.xml
Total time: 0 seconds
Error code 1 for command: cmd with args: /s,/c,ant,debug,-f,C:\Users\Administrator\Desktop\test\fakeApp\platforms\androi
d\build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Error: C:\Users\Administrator\Desktop\test\fakeApp\platforms\android\cordova\build.bat: Command failed with exit code 2
at ChildProcess.whenDone (C:\Users\Administrator\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\s
rc\cordova\superspawn.js:131:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
I thought maybe it was a path issue since I have a special letter in the path were the NetBeansProjects are stored (and it's pretty long too), but creating a test directory at C:\ and creating the project with the command window gave the same error. I'm new at Cordova so I'm sure there's an easy solution, thanks in advance.
I solved it, though I tried to create a cordova project outside the OneDrive folder I did not think of the SDK path (which also were stored in OneDrive). By moving the SDK files to C: (the path could probably not contain the special letter 'ø') and changing the path of the environment variables (and the SDK path in NetBeans) it now runs perfectly.

Error executing programs/compiling inside IntelliJ, no errors in command line

I recently bought a Macbook Air and it's now running Mountain Lion, but i have some problems running the company's project, the only other person using a mac on work runs Lion on his Macbook Pro and he had no such problems.
As the title says theres no problem compiling the project on the command line, but when i try to compile it inside IntelliJ i get this error
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (requireJS-Optimizer) on project MarfeelTouch: Command execution failed. Cannot run program "node" (in directory "/Users/pedrompg/Documents/Marfeel/MarfeelTouch"): error=2, No such file or directory -> [Help 1]
The problem also happens when i compile it from the command line and try to run the program
Caused by: java.util.concurrent.ExecutionException: java.io.IOException: Cannot run program "phantomjs" (in directory "/Users/pedrompg/Documents/Tenants/vhosts/discoverint"): error=2, No such file or directory
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:232) ~[na:1.6.0_35]
at java.util.concurrent.FutureTask.get(FutureTask.java:91) ~[na:1.6.0_35]
at com.marfeel.pressSystem.impl.SectionPressImpl.getAllItemsFromSectionFeeds(SectionPressImpl.java:137) ~[MarfeelPressSystem-1.0.jar:na]
... 29 common frames omitted
It seems that i can't run any command line programs from inside the project
This is how we the phantomJS call:
private Process buildProcess() throws IOException {
Process process;
String[] invocationCmd = getInvocationCmd();
if (executionDirectory != null) {
if (LOG.isDebugEnabled()) {
LOG.info("Invoking PhantomJS with {} in {}.", Arrays.toString(invocationCmd), executionDirectory);
}
process = Runtime.getRuntime().exec(invocationCmd, null,
new File(executionDirectory));
} else {
if (LOG.isDebugEnabled()) {
LOG.info("Invoking PhantomJS with {} in {}.", Arrays.toString(invocationCmd));
}
process = Runtime.getRuntime().exec(invocationCmd, null);
}
return process;
}
the getInvocationCmd() returns the following array
[phantomjs,--load-images=no,--disk-cache=yes,--max-disk-cache-size=1048576,/Users/pedrompg/Documents/Marfeel/MarfeelHub/target/webapp/WEB-INF/classes/whiteCollar.js,marca/marca.js,http://www.marca.com/]
Don't know if i leave any relevant information
We use Maven, tomcat 7, nodeJS, phantomJS 1.5, nginx 1.2.4, java 1.6.0_35 on the project
Hope someone can help, i'm getting really worried about this, already wasted 2 days trying to solve this problem.
Thanks in advance
As you are using Mac, it's most likely environment related issue. Please note that on Mac GUI applications do not inherit Terminal environment variables, therefore if you have adjusted PATH variable and command works from the Terminal, it will not work when you try to run from other applications.
See the related questions about this Mac feature. Pay attention to the second link, Mountain Lion has different behavior for environment variables.
The easiest way to verify that it's the case and workaround the problem is to run IntelliJ IDEA from Terminal:
open -a /Applications/IntelliJ\ IDEA\ 11.app/
This way Terminal environment will be passed to IDEA and commands you can run from Terminal will also run from IntelliJ IDEA.

Categories

Resources