How to install maven? - windows

I had install maven3 on another computer without problem few days ago, but I don't understand this problem.
(I have read the http://maven.apache.org/download.cgi to install maven, follow the instructions)
My M2_HOME is : C:\maven\apache-maven-3.0.5
My JAVA_HOME is : C:\Program Files\Java\jdk1.7.0_10
My PATH : C:\Ruby193\bin;C:\devkit;C:\devkit\ansi\x64;C:\Ruby193\include\ruby-1.9.1;%M2_HOME%\bin;%JAVA_HOME%\bin
Each folder contain the program it should include.
But when I launch mvn --version in a new console, nothing happen. I have to kill my console because I can't do anything in it. (I waited for 3 minutes without results, just in case)
And so with all maven command.
Edit : Thanks to baba, a new info :)
The problem is only with Mingw. It works with a classical dos console.

You don't need ruby to have maven. You, however, need java.
On another note, try to go to where the binary of maven is:
as in:
C:\maven\apache-maven-3.0.5\bin
then execute mvn --version. Also, if it doesn't work, try manually calling mvn.bat (which should be there for a Windows installation) with --version argument. If it still doesn't work, something is wrong with your maven installation, and we can go from there.
But if it works, then it is a path issue.

Related

cannot install lein (Leiningen) for Clojure on macOS Catalina (10.15)

I've been unable to install Leiningen on macOS 10.15; I've followed the install instructions at leiningen.org.
The error I get is
gw#MacBook-Pro bin % sh lein
Error: -classpath requires class path specification
My classpath is
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Users/gw/usr/bin
and the lein install script (from leiningen.org) is in /Users/gw/usr/bin
Could the problem be leftover dirs/files from previous installations of lein?
My Macbook Pro is fairly new (< 1 year). Could it be that I don't have some software or package that's needed somewhere?
I've been banging about the Internet and the CLI for several hours and can't find a solution. Thanks in advance for your help.
I presume in your question above, you meant shell path and not classpath, and your PATH environment variable is set to what you showed in your question. If you installed lein as per the instructions, you should not need sh lein. Just lein should work.
I presume you've installed the lein from leiningen.org into /Users/gw/usr/bin and that it is executable.
Make sure that the new lein is in your path. See what which lein says. Does it point to the new lein? If you had a different version of lein installed via brew, it might be in /usr/local/bin which is first in your PATH.
Is java installed on your Macbook? Try java -version and see that it returns what you expect.
Make a new empty directory and cd to it.
Then run lein. It should show you the usage, if all is okay.
I don't know why this worked, but it did. I'm posting this because it may be a clue to someone who reads this.
Solution: I deleted the "empty" directory structure that I had created early (i.e., lein new foo) and recreated it from scratch (lein new foo). Everything worked fine.
My best guess as to why this worked is that I had created the old foo directory structure under an old version of lein (i.e., before I reinstalled lein), and something must have been different after I reinstalled lein. Your explanation may vary ;)

Gradle init isn't interactive

I am using gradle through command line for the first time. I am running the latest version of Ubuntu. My professor's instructions indicate that upon typing "gradle init" I should be prompted to say what type of project it is as well as the language, etc. Mine simply skips all of that and says "build successful" afterwards, my professors' file ends up with the proper directory structure and mine only has the basic root folders. From the quick searches I've done, I see that there is a difference between interactive and non-interactive responses, but I can't find anything regarding how to make it interactive.
My issue was I installed gradle with sudo apt install gradle which installs a very old version. Instead you can install sdk and then run sdk install gradle
If it says something along the lines of:
> Task :init SKIPPED
The build file 'build.gradle' already exists. Skipping build initialization.
BUILD SUCCESSFUL in 5s
Then it means you already have a Gradle build structure present. In order to initialize a new one, the directory you run it in must be empty.
I had this problem, too. Seems to be a bug.
You can tell gradle non-interactively what type to create, for example:
gradle init --type java-library
Other build types

Why won't APKTool execute?

I was using APKTool and have been doing a lot of trials, using all the versions of APKTool. However, upon to my dismay, it won't work. Whenever I use it it will just be:
-bash: ./apktool: No such file or directory
I don't know what to do, as I tried using "./" as what websites are telling me, but still it just gives me this.
What should I do to fix this error. Thanks :)
-----Edit (December 23, 2015)-------
I have found the solution to the problem and it was just a redownload of APKTool itself. It also helped when I gained an understanding of Terminal and the Command Line Tools. I advice you to do the same thing too.
Perhaps you should reinstall apktool. You can find how to do it here:
http://ibotpeaches.github.io/Apktool/install/
Using "./" means that you want to run file located in current folder. Since you mentioned "bash" your apktool should be probably installed in "/usr/local/bin" so when you complete the installation do not add "./" just type "apktool" to run it.
If you want to check where apktool is installed run "which apktool"
or simply use the apktool online: http://www.javadecompilers.com/apktool
No installation - no hassle!

Why does executing debug in 0.13.7 fail with "Could not find agent library jdwp:transport on the library path"?

After update from 0.13.6 to 0.13.7 I cannot debug with SBT.
It is installed using Homebrew. I tried to reinstall it, brew doctor shows nothing.
I did not change/reinstall Java between SBT update.
lgr$ sbt -v -jvm-debug 5005 "project webapp" run
[process_args] java_version = '1.8.0_25'
# Executing command line:
java
-Xms1024m
-Xmx1024m
-XX:ReservedCodeCacheSize=128m
-XX:MaxMetaspaceSize=256m
-agentlib:jdwp:transport=dt_socket,server=y,suspend=n,address=5005
-jar
/usr/local/Cellar/sbt/0.13.7/libexec/sbt-launch.jar
"project webapp"
run
Error occurred during initialization of VM
Could not find agent library jdwp:transport on the library path, with error: dlopen(libjdwp:transport.dylib, 1): image not found
I am unsure whether SBT is missing some library, or brew formula didn't install properly.
I will be helpful for any idea how to fix it.
Reinstalled Java, didn't help.
Workaround I downloaded SBT 0.13.6 and it works without problem, so I start to consider this as a sbt bug. Can anyone help to clarify if it is?
To piggyback on Eugene's answer above, since the fix is in a bash script, it is pretty easy to apply the fix from https://github.com/sbt/sbt-launcher-package/pull/85/files manually. Just edit bin/sbt-launch-lib.bash to have this:
addJava "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=$1"
Instead of this:
addJava "-agentlib:jdwp:transport=dt_socket,server=y,suspend=n,address=$1"
(Mind the : not = between jdwp and transport).
It is installed using Homebrew.
Homebrew install is sanctioned by sbt project as a recommended way to install on Mac, but we (I'm one of the sbt devs) currently don't control it. We do however have the official package sbt/sbt-launcher-package, and last I checked Homebrew is also using it.
Looking at git blame of the relevant part of the script, it seems like the debug option was "fixed" in sbt/sbt-launcher-package#83:
In sbt-launch-lib.bash, -Xdebug option is used for debugging. We should use -agentlib option for Java 5+.
Maybe your issue should be tracked as a bug in sbt/sbt-launcher-package.
The problem was fixed in the 0.13.8 version.
At my case the bash fix didn't help but running from bash as:
export SBT_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
sbt
helped. It is from here.

mvn and the make package error

OK. Here's the problem and it's driving me crazy!!!
I followed the instruction online, installed hadoop and when running the text it said snappy local library can't be loaded.
It's said I have to install snappy first and then install hadoop-snappy.
I download snappy-1.0.4 from google code and do the following:
cd ../snappy-1.0.4
./configure
make
sudo make install
Then it's the problem when:
mvn package -Dsnappy.prefix=/usr/local
The post online said by default the snappy should be installed in the /usr/local.
But I got the following error and no matter what I change the path, still get erro:
The goal you specified required a project to execute but there's no POM in the directory. Please verify you invoked the maven from the correct directory.
It's the wrong directory of mvn? Or improper of snappy? And it said lack of pom that should be a .xml that in no where I can find..
Please help!
Alright, so looking at that page, you are in the wrong directory.
The directory you should be in for that step is "hadoop-snappy" which you can see has a pom.xml, you can verify by looking at the github, https://github.com/electrum/hadoop-snappy.
So after you follow these steps from the guide you showed me.
Download it(hadoop-snappy) from GitHub
Install libtool, make sure ‘libtoolize’ works
Install Maven 3 if necessary
Change your directory to hadoop-snappy and run the command you were trying before.

Resources