Build Jenkins and deploy on Heroku - java

Uninstalled all version of java from my machine and reinstalled the version 7 of Oracle:
$ java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
$ mvn -v
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.7.0_80, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: pt_BR, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-61-generic", arch: "amd64", family: "unix"
why when using the foreman start the application works locally and when I do the build by Jenkins and implant in heroku the application launches java.lang.UnsupportedClassVersionError exception and Unsupported major.minor version 51.0? I'm using the wrong dependence? Where am I wrong?
I'm not getting solve this problem.
Any help will be very welcome!

Related

OSX Maven issues after homebrew maven opgrade

Immediately after I upgraded my Mac from maven 3.6.0 to 3.6.3 with homebrew, I was no longer able to build my maven project. I've been through torrents of version dependency problems, etc, but I'm hoping to avoid stepping through any more of that stuff than I need to. And before I continue, I wanted to bounce this off of you guys to see if it indicates anything ominous, or if it's ops normal (since I've never paid too much attention to it in the past.) In question is the variance in java version numbers between mvn --version and java -version, i.e., 1.8.0_191 vs 14.0.1:
$ java -version java version "1.8.0_191" Java(TM) SE Runtime
Environment (build 1.8.0_191-b12) Java HotSpot(TM) 64-Bit Server VM
(build 25.191-b12, mixed mode)
mvn --version Apache Maven 3.6.3
(cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home:
/usr/local/Cellar/maven/3.6.3_1/libexec Java version: 14.0.1, vendor:
N/A, runtime:
/usr/local/Cellar/openjdk/14.0.1/libexec/openjdk.jdk/Contents/Home
Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x",
version: "10.15.6", arch: "x86_64", family: "mac"
Thanks in advance!
Turns out my JAVA_HOME variable somehow evaporated in the homebrew upgrade. Once I set that, all 12 million problems disappeared instantly. Thanks for the comment khmarbaise!

Intellij 'mvn' is not recognized as an internal or external command

I have installed maven on my pc and if I type "mvn --version" in the cmd, I get:
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T14:57:37+03:00)
Maven home: C:\Users\mmmm\Downloads\apache-maven-3.3.3-bin\apache-maven-3.3.3
Java version: 1.8.0_251, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_251\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "dos"
The problem is that from Intellij, if I try to do a mvn clean install from the terminal, I get "'mvn' is not recognized as an internal or external command,
operable program or batch file."
My system variables contain these:
M2_HOME = C:\Users\mmmm\Downloads\apache-maven-3.3.3-bin\apache-maven-3.3.3
M2 = %M2_HOME%\bin
Path = %M2_HOME%\bin
How can I fix this?
I have also installed JDK 1.8 and Maven3 as below:
>java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
>javac -version
javac 1.8.0_121
>mvn -version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:\SDK\maven\apache-maven-3.6.3\bin\..
Java version: 1.8.0_121, vendor: Oracle Corporation, runtime: C:\java\jdk1.8\jre
Default locale: en_US, platform encoding: MS932
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
I found the problem is the environment variables of terminal:
Copy your bin path of JDK and Maven into it!! And then restart your Terminal.
I had a similar issue that was fixed after I pointed M2_HOME to Intellij's maven plugin path instead of pointing to a path associated with a separate maven installation.
"C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.2.3\plugins\maven\lib\maven3"
I also added %M2_HOME%\bin to PATH.

Apache tika and apache ctakes

~$ java -version
java version "1.8.0_212"
Java(TM) SE Runtime Environment (build 1.8.0_212-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.212-b10, mixed mode)
~$ mvn -version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T22:11:47+05:30)
Maven home: /opt/maven
Java version: 1.8.0_212, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux", version: "4.13.0-37-generic", arch: "amd64", family: "unix"
apache tika 1.23
apache ctakes 3.2.2
ubuntu 16.04 LTS
I have followed the steps on the official site.
while the step
java -classpath $HOME/src/ctakes-config:${TIKA_HOME}/tika-app/target/tika-app-X.Y-SNAPSHOT.jar:${CTAKES_HOME}/desc:${CTAKES_HOME}/resources:${CTAKES_HOME}/lib/\* org.apache.tika.cli.TikaCLI --config=$HOME/src/ctakes-config/tika-config.xml -m Vose-2013-American_Journal_of_Hematology.pdf
I am getting this error:
Error: Could not find or load main class org.apache.tika.cli.TikaCLI
please help
Probably you did not set the variables TIKA_HOME and/or CTAKES_HOME in the environment you want to run the command.

Cannot use string in case even though I am using Java 8?

Sorry that I have to ask this quite easy question. I am using OSX with Java 8 installed and maven. But I can't mvn install a code using string in case. Can you point out what's wrong?
mvn -version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)
Maven home: /usr/local/apache-maven-3.3.9
Java version: 1.8.0_45, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre
Default locale: zh_TW, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.2", arch: "x86_64", family: "mac"
Code error msg
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/Briancheung/Documents/projects/webcompiler/dev/parser/src/main/java/project/Preference.java:[40,23]
strings in switch are not supported in -source 1.5
(use -source 7 or higher to enable strings in switch)
[INFO] 1 error
It seems that maven is not using Java 8 JDK I have installed. Thank you for any response.
java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
javac -version
javac 1.8.0_45

How to check which version of Java, Maven, Gradle

How to check which version of Java, Maven, Gradle, NodeJs installed on your machine and how to set environment variables for all these building tools or JDK ?
Goto your CMD (for Windows) or shell terminal (for linux / ubuntu)
To check which Java version and compiler version installed:
C:\>java -version
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
Here you can check compiler version
C:\>javac -version
javac 1.7.0_71
To check which version of Maven installed: Use(mvn -v or mvn version)
C:\>mvn -v
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T22:59:23+05:30)
Maven home: C:\apache-maven-3.2.5
Java version: 1.7.0_71, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_71\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
To check which version of Gradle installed:
C:\>gradle -version
------------------------------------------------------------
Gradle 2.2.1
------------------------------------------------------------
Build time: 2014-11-24 09:45:35 UTC
Build number: none
Revision: 6fcb59c06f43a4e6b1bcb401f7686a8601a1fb4a
Groovy: 2.3.6
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM: 1.7.0_71 (Oracle Corporation 24.71-b01)
OS: Windows 7 6.1 amd64
To check which version of node installed:
C:\>node -v
v0.12.0
Setting environment variables for
1) JAVA
Windows: Set the environment variable JAVA_HOME to C:\Program Files\Java\jdk1.6.0_21
Linux: export JAVA_HOME=/usr/local/java-current
2) Maven
(extract distribution here (You can extract any where you want)
Windows: C:\Program Files\Apache Software Foundation\apache-maven-3.2.1
Linux: /usr/local/apache-maven
Windows:-
M2_HOME=C:\Program Files\Apache Software Foundation\apache-maven-2.2.1
M2=%M2_HOME%\bin
MAVEN_OPTS=-Xms256m -Xmx512m
Linux:
Open command terminal and set environment variables.
export M2_HOME=/usr/local/apache-maven/apache-maven-2.2.1
export M2=$M2_HOME/bin
export MAVEN_OPTS=-Xms256m -Xmx512m
3)

Categories