How to check apache maven version 3.1.1 or newer is installed in a machine? - apache

I am absolutely new to Java Enterprise Edition and can someone help me by providing the steps needed to check whether Apache maven version 3.1.1 or newer is installed in a machine?

You can check it by executing mvn -version.
if the command is not found, no version is installed correctly else there is an output of the maven version.
If you want to check it programatically you can write an java application which executes the mvn -version command and reads the result of the process.
(Search for java Runtime.getRuntime().exec )

Related

Gradle sync fails when creating a new Kotlin project with default settings in freshly installed IntelliJ IDEA

I wanted to learn some Kotlin so I installed IntelliJ IDEA, created a new Kotlin project with the default settings and then the IDE tells me that Gradle sync has failed. Here's the error message:
Could not open init generic class cache for initialization script 'C:\Users\<my_name>\AppData\Local\Temp\wrapper_init.gradle' (C:\Users\<my_name>\.gradle\caches\6.8\scripts\344chmz69zyndatc9zp4rwux5).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 60
I googled the error and got a suggestion to try a different JDK version. Tried a few different versions but that didn't help. Then I installed the IDE on my laptop to see if that works and there I don't get any errors. As far as I can tell, the project settings were exactly the same on both machines but obviously something is messed up on my desktop computer. Both have Windows 10.
I'm also not at all familiar with the Java/Kotlin ecosystem or the build tools or whatever so I honestly have no idea how I could even begin fixing some Gradle errors. I don't really even know what Gradle is or what it does. So can you help me?
First, check the version which the project uses: File > Project Structure. Or, during project creation (https://i.stack.imgur.com/SXIzQ.png / example with SDK 1.8)
It has to be the same as JDK / SDK installed on your computer.
To verify java version installed in your terminal:
java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~19.10-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)

Installing the Subversion Plugin in studio Version: 7.4.2 fails

Installing the Subversion Plugin in studio Version: 7.4.2 fails.
Tried with http://subclipse.tigris.org/update_1.6.x and other versions too.
The site http://subclipse.tigris.org appears to be abandoned, and subclipse 1.6 is an old version that is probably not compatible with the Eclipse version used for Studio 7.4.2. According to the release notes it is based on Eclipse 4.9. You should look for an updated version of subclipse that is compatible with that Eclipse version.
It seems that the current home of Subclipse is this GitHub project: https://github.com/subclipse/subclipse. Try installing from their distributions: https://github.com/subclipse/subclipse/wiki#installation

Update dotnet cli in Mac OSX

Im'm trying to upgrade my dotnet cli. I have installed in my Mac (OS El Capitan) from the official link.
But when I try to view the version with this code:
dotnet --version
My output:
1.0.0-preview2-003121
How can I upgrade?
The version 1.0.0-preview2-003121 of the .Net CLI is currently the latest released version. So there is no newer released version to upgrade to.
You could upgrade to the latest build from the dotnet/cli repo, but you probably shouldn't, since that's not a released version.
To update from 2.0.3 to 2.1.4 I simply downloaded the installer from Microsoft's website and then ran the installer.
`https://download.microsoft.com/download/1/1/5/115B762D-2B41-4AF3-9A63-92D9680B9409/dotnet-sdk-2.1.4-osx-gs-x64.pkg
I had a Terminal window open, and when I did a dotnet --version before and after running the installer, the correct version was output to the console. I did not have to restart my terminal window even.
Microsoft has done a good job at packaging the SDK and CLI together. See either their main dotnetcore website or go to their git

Spring data redis mock

I need to do integration testing for a spring cloud application running with spring data on redis.
Tests work locally with the regular redis server instance and I need to run this on a Jenkins CI server that is controlled by the corporate CI engineering group.
Obviously I can attach to a redo server there so I used an embedded redis server (from here: https://github.com/kstyrc/embedded-redis).
Running tests locally with this redis server works well since there is a test profile to inject the embedded server in place of the production one.
Now the problem is that when we run this in the Jenkins environment this is the error we see.
/tmp/1430170830037-0/redis-server-2.8.19: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /tmp/1430170830037-0/redis-server-2.8.19)
So this version of redis has specific dependency on a specific version of glibc. I tried a couple of other libraries but they all depend on the same underlying version of the embedded redis server.
Is there a spring data mock framework that can be used to get around this sort of issue?
This might come a little late for you, but there is indeed a Spring Data Mock framework that you can use, which let's you mock repositories (regardless of the specific backend solution) without a real database connection.
Here is a link: https://github.com/mmnaseri/spring-data-mock
You don't have a high enough version of libc6, that is causing the error.
From How to fix “/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found”? – Super User:
That means the program was compiled against glibc version 2.14, and it requires that version to run, but your system has an older version installed. You'll need to either recompile the program against the version of glibc that's on your system, or install a newer version of glibc (the "libc6" package in Debian).
So, you just need to upgrade your libc6 package. All versions of Ubuntu have at least version 2.15 because it's a faily important package (reference).
To upgrade it, use these commands in a terminal:
sudo apt-get update
sudo apt-get install libc6
p.s. This is answer from askubuntu.com by minerz029

Installing Glassfish tools in eclipse luna

Im trying to install Glassfish tools in eclise Luna but I keep getting this error message:
Cannot complete the install because one or more required items could not be found.
Software being installed: GlassFish Tools 7.3.3.201412231459 (oracle.eclipse.tools.glassfish.feature.group 7.3.3.201412231459)
Missing requirement: GlassFish Tools 7.3.3.201412231459 (oracle.eclipse.tools.glassfish.feature.group 7.3.3.201412231459) requires 'org.eclipse.sapphire.feature.group [8.1.0,8.2.0)' but it could not be found
What should I do? Thanks.
It looks like they somehow messed up the plugin dependencies while packaging the plugin version which is currently referenced by the .
To fix it you have to install an slightly older version of the Glassfish Tools manually. To do this in Eclipse click on Help -> Install new software and put the following URL in the upper input field:
http://download.oracle.com/otn_software/oepe/12.1.3.1/luna/repository
Then click enter, after it has fetched the installable packages, choose the Glassfish Tools package and the Oracle Java EE Tools package (both should be version 7.2.0.xxx) and install. The installation can take a while because the oracle repository site is often slow.
See also:
How to configure Glassfish Server in Eclipse Luna manually
Define a New Server choosing GlassFish 3.1 gives Internal Error - Eclipse Luna
see on eclipse marketplace the minimum version of Java required to run GlassFish Tools.
Mars - Java 8
Luna - Java 8
Kepler - Java 7
Juno - Java 6
See more at:
https://marketplace.eclipse.org/content/glassfish-tools
Go with Eclipse Luna + RedHat JBoss WildFly 8.2, which is working just fine.