I'm trying to enable TSLv1.2 in my machine which has java 1.7 using the commands -mvn -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2 install / mvn -Dhttps.protocols=TLSv1.2 install.
But its throwing some errors saying my pom.xml has some unresolved dependencies, those dependencies errors are there because my project couldn't download from maven repository due to TSLv1.2 issue.
Seems like a deadlock to me, Can anyone help me on how to resolve it?
You need to configure MAVEN_OPTS env variable or settings.xml to pass proper vm args to JVM (maven JVM)
For quick test, try this
set MAVEN_OPTS with -Dhttps.protocols=TLSv1.2,TLSv1.1
export MAVEN_OPTS=-Dhttps.protocols=TLSv1.2,TLSv1.1
(export is for unix based system, for windows see here)
and re-run your maven command
read more on maven's configuration
Related
I am facing a strange thing while running mvn install for a project. While executing the Copying webapp resources step the JVM crashed. I get a windows pop up saying Java has stopped working. I am not getting any error message in the console so that I can get hold of the root cause. Any help is appreciated.
Try the below steps :
1. Use JDK instead of JRE in Installed JREs.
Eclipse Path (Windows--Preference--Java--Installed JREs )
2. Use this option for maven :
clean install -Djava.net.preferIPv4Stack=true
(in Run As Maven Build --- Goals)
[Try to find the JVM crash report if available in your machine]
I am trying to update from java 8 to OpenJdk 11. When I do mvn install from terminal, build works fine. But fails from (mac) intelliJ mvn install
Below is the startup command
/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home/bin/java -Dmaven.multiModuleProjectDirectory=/Users/myhome/Documents/WORKSPACES/something/develop "-Dmaven.home=/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3" "-Dclassworlds.conf=/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/bin/m2.conf" -Didea.launcher.port=53262 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/boot/plexus-classworlds-2.5.2.jar:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar" com.intellij.rt.execution.application.AppMainV2 org.codehaus.classworlds.Launcher -Didea.version=2018.2.6 -s /Users/myhome/Documents/config/maven/apache-maven-3.6.0/conf/settings.xml -Dmaven.repo.local=/Users/myhome/Documents/config/maven/repo install
Below is a sample error line
[ERROR]
/Users/myhome/Documents/WORKSPACES/something/SomeClass.java:[7,33]
cannot access org.springframework.kafka.support
[ERROR] zip END header not found
Any tip to fix it ?
(Already updated SDKs in platform settings to OpenJdk11, Maven>Runner is using OpenJdk11, Java Compiler updated to 11.
]2
I meet this error when build with gradlew, after remove the cache of gradle it works.
Solution in gradle wrapper build
rm ~/.gradle/*
If you use maven, maybe remove every thing in local maven wrapper will do the same thing.
if you used intellij idea for create some code, maybe your forgot to enable gradle, when i am facing same error . i just enable gradle on my intellij idea and then my error is resolving.
you just choose preferences -> plugins -> enable gradle if there is not enable
hope this solution can help you.
Upgrading to IntelliJ Version 2018.3.4 fixed this issue.
You could also try to delete .gradle folder as suggested by #Ninja
I am getting the following error while using the following command
mvn clean install package
Error
No compiler is provided in this environment. Perhaps you are running
on a JRE rather than a JDK?
I have tried the solutions already present online but none of them worked, I have my JDK path selected in the installed JRE's on my eclipse.
I am using Ubuntu 16.04. Can someone help?
I have already tried the solution given in No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
but that didn't help. I already have my JDK path selected correctly
Check JAVA_HOME path is set as the environment variable pointing to JDK. Refer maven installation steps for more information.
https://maven.apache.org/install.html
Give the jdk path in /etc/environment
Eg : JAVA_HOME="/usr/lib/jvm/java-8-oracle"
then
source /etc/environment
also add in bashrc
vi ~/.bashrc
export JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-amd64"
source ~/.bashrc
I had this same exact error.
There are a lot of possible solutions posted for this problem, even more duplicates. However, after checking many of them I did not find the solution. After some tries and investigations among my environment settings I have found out that the issue was caused by having multiple java paths pointing to different versions that were set up by different IDE's. Also, it seems that Maven was trying to use the first version it found in the PATH settings which actually appeared to be a JRE version.
The solution for me was to put the path pointing to Java JDK as the first path in the PATH environment settings.
Also, make sure that the new environment settings are in effect before you try to use Maven again.
A very simple way to see if mvn actually tries to use the JDK is to execute the following command:
mvn -version
It will print out the Java paths along with other info.
I am building a maven project, since last 1.5 yrs build was working fine but now I am getting the PermGen space error.
[ERROR] Internal error: java.lang.RuntimeException: org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded() listener has failed: java.io.IOException: Remote call on channel failed: PermGen space -> [Help 1]
[ERROR] org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded() listener has failed:
java.lang.OutOfMemoryError: PermGen space
I have tried below options in order to resolve it:-
1) Under Manage Jenkins, then Configure System. In the Global properties section, added Environment Variables called MAVEN_OPTS with the value set as -Xmx200m -XX:MaxPermSize=512m
2) Under job configuration, then Build, in the MAVEN_OPTS, added below properties:-
-DXms512m
-DXmx1024m
-DXX:PermSize=512m
-DXX:MaxPermSize=1024m
-DXX:+CMSClassUnloadingEnabled
-DXX:+UseConcMarkSweepGC
Still the error is occurring.
Note:- Error is not permanent, it goes away after few builds but again start appearing and then again goes away after several retries.
Thanks.
Maybe I'm wrong, but it seems that your memory error happens when Jenkins try to send the build information to Artifactory (with a post step action).
Did you upgrade the Jenkins Artifactory plugin recently?
Can you try do disable the "Capture and publish build info" option?
And last option, can you try update the JENKINS_JAVA_OPTIONS (in the jenkins service config file) to increase the MaxPermSize?
## Type: string
## Default: "-Djava.awt.headless=true"
## ServiceRestart: jenkins
#
# Options to pass to java when running Jenkins.
#
JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true -Xms2G -Xmx4G -XX:MaxPermSize=256m"
As Maven project deploys artifacts not during build step on a node, but on the master, I suspect Permgen problem could by resolved by either upgrading Jenkins core, plugins or by increasing Permgen max size in Jenkins startup options.
ps. Java 8 obsoletes Permgen.
maybe I am blind and you have written it somewhere but when I have faced a similar issue, then I have upgraded the JRE version for Jenkins itself from 7 to 8. The problem started, when I have used Jenkins 2.X and Java 7.
Best regards,
Max
on centos6 install jenkins by rpm or yum
vim /etc/sysconfig/jenkins
JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true -Xmx1024m -XX:MaxPermSize=512m"
I just installed hudson on my ubuntu machine and in the configuration page i see that hudson did not detect the JDK,Ant & Maven installed on my machine..
Is this common or i should do the configuration manually.
I tried adding the /usr/bin/ in the JAVA_HOME variable but it says it is not a directory..
Actually, I was thinking that hudson to detect Java and Ant installations on my system and display there..but i was wrong.
So i manually added the path for JAVA_HOME and ANT_HOME
I scheduled builds also and it is working great :)