You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ole Ersoy <ol...@gmail.com> on 2014/12/31 17:49:11 UTC
Strange Issue
Hi,
I'm seeing some strange behavior with Maven 3.0.5 on Ubuntu.
BACKGROUND
=====================
When I run `mvn test` the console prints:
`[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?`
If I then open the project in Eclipse and run the test it runs fine. Subsequently if I close Eclipse and run the test with `mvn test` I get `BUILD SUCCESS`.
ANALYSIS
=====================
I run `mvn test` on the `test2` project, that was opened with eclipse, and I get -> `BUILD SUCCESS`.
I then create a `test3` project, copy the pom and the src directory from test2 to test 3. When running `mvn test` on the `test3` project I get the error again. I included the result from my console below:
ole@MKI:~/test2$ mvn test
Warning: JAVA_HOME environment variable is not set.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test-maven 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ test-maven ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/ole/test2/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ test-maven ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.3:testResources (default-testResources) @ test-maven ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/ole/test2/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) @ test-maven ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ test-maven ---
[INFO] Surefire report directory: /home/ole/test2/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running hello.HelloUnitTest
Greeting from hello the Unit Test!
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.039 sec
Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.027s
[INFO] Finished at: Wed Dec 31 10:41:25 CST 2014
[INFO] Final Memory: 8M/240M
[INFO] ------------------------------------------------------------------------
ole@MKI:~/test2$ mkdir ../test3
ole@MKI:~/test2$ cp pom.xml ../test3
ole@MKI:~/test2$ cp -r src ../test3
ole@MKI:~/test2$ cd ../test3/
ole@MKI:~/test3$ mvn test
Warning: JAVA_HOME environment variable is not set.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test-maven 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ test-maven ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/ole/test3/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ test-maven ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.3:testResources (default-testResources) @ test-maven ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/ole/test3/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) @ test-maven ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 1 source file to /home/ole/test3/target/test-classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.722s
[INFO] Finished at: Wed Dec 31 10:42:07 CST 2014
[INFO] Final Memory: 8M/303M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:testCompile (default-testCompile) on project test-maven: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
ole@MKI:~/test3$ tree
.
├── pom.xml
├── src
│ └── test
│ └── java
│ └── hello
│ └── HelloUnitTest.java
└── target
├── generated-test-sources
│ └── test-annotations
├── maven-status
│ └── maven-compiler-plugin
│ └── testCompile
│ └── default-testCompile
│ ├── createdFiles.lst
│ └── inputFiles.lst
└── test-classes
12 directories, 4 files
Thoughts (Besides just open it in Eclipse :) )?
TIA,
- Ole
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Strange Issue
Posted by Luis Torres <lr...@berkeley.edu>.
Hi Ole and Mark,
I ran into a similar problem before, what I did to resolve the issue is I
ran 'mvn -version' to see what Maven "thought" it was using for a JDK, then
I investigated the Eclipse settings to see if it was using the same exact
JDK - you may need to point the Java configuration to a JDK (install one if
you haven't done so already). The other point to look at is to see whether
the Maven runtime Eclipse is using is the embedded plugin or some other
plugin, I tend to point the Eclipse mvn executable to my command-line
install.
-L-
On Wed, Dec 31, 2014 at 9:52 AM, Ole Ersoy <ol...@gmail.com> wrote:
> Hi Mark,
>
> I do have Open JDK installed. The reason this is strange is because the
> maven build runs fine from the command line after the project is run with
> Eclipse. Other maven builds I have also run fine from the command line.
> For example if I git clone apache commons math and run the build, it builds
> fine.
>
> In this case I'm just creating a very minimal project with:
> - pom.xml
> - src/test/java/hello/HelloTest.java
>
> When I try to run the build, it fails. If I import it into eclipse, it
> runs. When I try the build from the command line again, it runs. If I
> create another project with the same set of original resources, it fails
> all over again.
>
> Thoughts?
>
> Thanks again,
> Ole
>
>
>
> On 12/31/2014 11:17 AM, Mark Eggers wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 12/31/2014 8:49 AM, Ole Ersoy wrote:
>>
>>> Hi,
>>>
>>> I'm seeing some strange behavior with Maven 3.0.5 on Ubuntu.
>>>
>>> BACKGROUND ===================== When I run `mvn test` the console
>>> prints: `[ERROR] No compiler is provided in this environment.
>>> Perhaps you are running on a JRE rather than a JDK?`
>>>
>>> If I then open the project in Eclipse and run the test it runs
>>> fine. Subsequently if I close Eclipse and run the test with `mvn
>>> test` I get `BUILD SUCCESS`.
>>>
>>> ANALYSIS ===================== I run `mvn test` on the `test2`
>>> project, that was opened with eclipse, and I get -> `BUILD
>>> SUCCESS`.
>>>
>>> I then create a `test3` project, copy the pom and the src directory
>>> from test2 to test 3. When running `mvn test` on the `test3`
>>> project I get the error again. I included the result from my
>>> console below:
>>>
>>> ole@MKI:~/test2$ mvn test Warning: JAVA_HOME environment variable
>>> is not set. [INFO] Scanning for projects... [INFO] [INFO]
>>> ------------------------------------------------------------------------
>>>
>>>
>>> [INFO] Building test-maven 1.0.0
>>
>>> [INFO]
>>> ------------------------------------------------------------------------
>>>
>>>
>>> [INFO]
>>
>>> [INFO] --- maven-resources-plugin:2.3:resources (default-resources)
>>> @ test-maven --- [WARNING] Using platform encoding (UTF-8 actually)
>>> to copy filtered resources, i.e. build is platform dependent!
>>> [INFO] skip non existing resourceDirectory
>>> /home/ole/test2/src/main/resources [INFO] [INFO] ---
>>> maven-compiler-plugin:3.2:compile (default-compile) @ test-maven
>>> --- [INFO] No sources to compile [INFO] [INFO] ---
>>> maven-resources-plugin:2.3:testResources (default-testResources) @
>>> test-maven --- [WARNING] Using platform encoding (UTF-8 actually)
>>> to copy filtered resources, i.e. build is platform dependent!
>>> [INFO] skip non existing resourceDirectory
>>> /home/ole/test2/src/test/resources [INFO] [INFO] ---
>>> maven-compiler-plugin:3.2:testCompile (default-testCompile) @
>>> test-maven --- [INFO] Nothing to compile - all classes are up to
>>> date [INFO] [INFO] --- maven-surefire-plugin:2.10:test
>>> (default-test) @ test-maven --- [INFO] Surefire report directory:
>>> /home/ole/test2/target/surefire-reports
>>>
>>> ------------------------------------------------------- T E S T S
>>> ------------------------------------------------------- Running
>>> hello.HelloUnitTest Greeting from hello the Unit Test! Tests run:
>>> 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.039 sec
>>>
>>> Results :
>>>
>>> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
>>>
>>> [INFO]
>>> ------------------------------------------------------------------------
>>>
>>>
>>> [INFO] BUILD SUCCESS
>>
>>> [INFO]
>>> ------------------------------------------------------------------------
>>>
>>>
>>> [INFO] Total time: 1.027s
>>
>>> [INFO] Finished at: Wed Dec 31 10:41:25 CST 2014 [INFO] Final
>>> Memory: 8M/240M [INFO]
>>> ------------------------------------------------------------------------
>>>
>>>
>>> ole@MKI:~/test2$ mkdir ../test3
>>
>>> ole@MKI:~/test2$ cp pom.xml ../test3 ole@MKI:~/test2$ cp -r src
>>> ../test3 ole@MKI:~/test2$ cd ../test3/ ole@MKI:~/test3$ mvn test
>>> Warning: JAVA_HOME environment variable is not set. [INFO] Scanning
>>> for projects... [INFO] [INFO]
>>> ------------------------------------------------------------------------
>>>
>>>
>>> [INFO] Building test-maven 1.0.0
>>
>>> [INFO]
>>> ------------------------------------------------------------------------
>>>
>>>
>>> [INFO]
>>
>>> [INFO] --- maven-resources-plugin:2.3:resources (default-resources)
>>> @ test-maven --- [WARNING] Using platform encoding (UTF-8 actually)
>>> to copy filtered resources, i.e. build is platform dependent!
>>> [INFO] skip non existing resourceDirectory
>>> /home/ole/test3/src/main/resources [INFO] [INFO] ---
>>> maven-compiler-plugin:3.2:compile (default-compile) @ test-maven
>>> --- [INFO] No sources to compile [INFO] [INFO] ---
>>> maven-resources-plugin:2.3:testResources (default-testResources) @
>>> test-maven --- [WARNING] Using platform encoding (UTF-8 actually)
>>> to copy filtered resources, i.e. build is platform dependent!
>>> [INFO] skip non existing resourceDirectory
>>> /home/ole/test3/src/test/resources [INFO] [INFO] ---
>>> maven-compiler-plugin:3.2:testCompile (default-testCompile) @
>>> test-maven --- [INFO] Changes detected - recompiling the module!
>>> [WARNING] File encoding has not been set, using platform encoding
>>> UTF-8, i.e. build is platform dependent! [INFO] Compiling 1 source
>>> file to /home/ole/test3/target/test-classes [INFO]
>>> -------------------------------------------------------------
>>> [ERROR] COMPILATION ERROR : [INFO]
>>> -------------------------------------------------------------
>>> [ERROR] No compiler is provided in this environment. Perhaps you
>>> are running on a JRE rather than a JDK? [INFO] 1 error [INFO]
>>> -------------------------------------------------------------
>>> [INFO]
>>> ------------------------------------------------------------------------
>>>
>>>
>>> [INFO] BUILD FAILURE
>>
>>> [INFO]
>>> ------------------------------------------------------------------------
>>>
>>>
>>> [INFO] Total time: 0.722s
>>
>>> [INFO] Finished at: Wed Dec 31 10:42:07 CST 2014 [INFO] Final
>>> Memory: 8M/303M [INFO]
>>> ------------------------------------------------------------------------
>>>
>>>
>>> [ERROR] Failed to execute goal
>>
>>> org.apache.maven.plugins:maven-compiler-plugin:3.2:testCompile
>>> (default-testCompile) on project test-maven: Compilation failure
>>> [ERROR] No compiler is provided in this environment. Perhaps you
>>> are running on a JRE rather than a JDK? [ERROR] -> [Help 1]
>>> [ERROR] [ERROR] To see the full stack trace of the errors, re-run
>>> Maven with the -e switch. [ERROR] Re-run Maven using the -X switch
>>> to enable full debug logging. [ERROR] [ERROR] For more information
>>> about the errors and possible solutions, please read the following
>>> articles: [ERROR] [Help 1]
>>> http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
>>>
>>> ole@MKI:~/test3$ tree . ├── pom.xml ├── src │ └── test │
>>> └── java │ └── hello │ └──
>>> HelloUnitTest.java └── target ├── generated-test-sources │ └──
>>> test-annotations ├── maven-status │ └── maven-compiler-plugin │
>>> └── testCompile │ └── default-testCompile │
>>> ├── createdFiles.lst │ └── inputFiles.lst └──
>>> test-classes
>>>
>>> 12 directories, 4 files
>>>
>>> Thoughts (Besides just open it in Eclipse :) )?
>>>
>>> TIA, - Ole
>>>
>> Eclipse comes with its own compiler, so it only needs the JRE to run.
>>
>> The command line needs the JDK, which you don't have installed.
>>
>> Install the JDK, set $JAVA_HOME, and make sure $JAVA_HOME/bin is on
>> your path.
>>
>> See the bottom of the following page for detailed instructions:
>>
>> http://maven.apache.org/download.cgi
>>
>> If you're uncomfortable about using a different Java version between
>> command line and Eclipse, you can always point Eclipse to the JRE
>> inside the JDK and use that as the default JRE for Eclipse and the IDE.
>>
>> . . . just my two cents
>> /mde/
>>
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v2
>>
>> iQEcBAEBAgAGBQJUpC/HAAoJEEFGbsYNeTwtO2kIAKEr2DC7OZt2hNMDhpuXtPqF
>> /XtQHTMRR6W0SFXXkCDe4tqa2mGpQLSNUjXYUoDyw9QqX0YiS/X4kZwsPZOSjvrV
>> fyYccm48U1/njdS6yiWbeuDqVSHGvWfrf7vv1L+/j28YhI8ZxM9PaXXJ05iBECmW
>> t88hDHHNJpewf9IkIED5EHyFhie+pLqh+nITtLdrKx70zUwr6nVVXDglfbUbAuMK
>> LueQ8hGWeQdpaj98zo0BnJYpi2bIRQ7inLNOthRDgSBZkcRVWHln4Gv05UFt/vhP
>> en924SAlSRrSenKub7HhWzI0GaGnSGSyf1TRY75za6zgSNWbGVieb36pFyoqYd4=
>> =BFis
>> -----END PGP SIGNATURE-----
>>
>> ---
>> This email is free from viruses and malware because avast! Antivirus
>> protection is active.
>> http://www.avast.com
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Re: Strange Issue
Posted by Bernd Eckenfels <ec...@zusammenkunft.net>.
Am Wed, 31 Dec 2014 14:09:39 -0600
schrieb Ole Ersoy <ol...@gmail.com>:
> Thanks!! You were right all along. I just did a fresh install on my
> machine, and all my other builds were running fine, so I thought the
> entire JDK had been pulled in by one of my dependencies. Once I did
> a `mvn clean` on these builds, they also stopped building.
BTW: maven does not "pull in the JDK". The reason why it builds
with Eclipse is, it has its own compiler and does not need a JDK (for
this).
And when command-line maven sees compiled classes which are newer than
the java source, it will not try to compile them.
So only if your target directory is empty or a java file was modified
after comile maven will try to start the compiler (from the JDK). Most
other stuff works with only a JRE.
Gruss
Bernd
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Strange Issue
Posted by Bernd Eckenfels <ec...@zusammenkunft.net>.
Hello,
is there a directory /usr/lib/jvm/java-7-openjdk-amd64/include/? If
not, this is not the JDK but the JRE version.
http://packages.ubuntu.com/en/precise/amd64/openjdk-7-jre/filelist
http://packages.ubuntu.com/en/precise/amd64/openjdk-7-jdk/filelist
In that case it will help to install openjdk-7-jdk package.
It is quite possible that you do not have any JDK on your machine, if
you do not, it will help to install openjdk-7-jdk. If you do have one,
you need to find it and set JAVA_HOME to it. This will not only resolve
your problem, but also remove the warning :)
Gruss
Bernd
Am Wed, 31 Dec 2014 13:09:33 -0600
schrieb Ole Ersoy <ol...@gmail.com>:
> Bernd, Mark,
>
> Here is the result of `mvn --version`:
> Apache Maven 3.0.5
> Maven home: /usr/share/maven
> Java version: 1.7.0_65, vendor: Oracle Corporation
> Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux", version: "3.13.0-43-generic", arch: "amd64",
> family: "unix"
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Strange Issue
Posted by Ole Ersoy <ol...@gmail.com>.
Bernd, Mark,
Here is the result of `mvn --version`:
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.7.0_65, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-43-generic", arch: "amd64", family: "unix"
This is the project structure:
ole@MKI:~/test2$ tree
.
├── pom.xml
└── src
└── test
└── java
└── hello
└── HelloUnitTest.java
4 directories, 2 files
Sequence:
- `mvn clean`
- Now the compilation error occurs.
- Import the project into eclipse
- Run the test. It runs fine.
- Try 'mvn test'
- Runs fine
- Run `mvn clean`
- Run `mvn test`
- Compilation error
Here's a dump of my terminal:
ole@MKI:~/test2$ mvn clean
Warning: JAVA_HOME environment variable is not set.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test-maven 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ test-maven ---
[INFO] Deleting /home/ole/test2/target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.635s
[INFO] Finished at: Wed Dec 31 12:39:57 CST 2014
[INFO] Final Memory: 6M/240M
[INFO] ------------------------------------------------------------------------
ole@MKI:~/test2$ mvn test
Warning: JAVA_HOME environment variable is not set.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test-maven 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ test-maven ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/ole/test2/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ test-maven ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.3:testResources (default-testResources) @ test-maven ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/ole/test2/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) @ test-maven ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 1 source file to /home/ole/test2/target/test-classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.958s
[INFO] Finished at: Wed Dec 31 12:40:06 CST 2014
[INFO] Final Memory: 7M/240M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:testCompile (default-testCompile) on project test-maven: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
ole@MKI:~/test2$
===========================
RUN TEST WITH ECLIPSE - THEN TERMINAL
===========================
ole@MKI:~/test2$ mvn test
Warning: JAVA_HOME environment variable is not set.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test-maven 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ test-maven ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/ole/test2/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ test-maven ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.3:testResources (default-testResources) @ test-maven ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/ole/test2/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) @ test-maven ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ test-maven ---
[INFO] Surefire report directory: /home/ole/test2/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running hello.HelloUnitTest
Greeting from hello the Unit Test!
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.065 sec
Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.323s
[INFO] Finished at: Wed Dec 31 12:52:48 CST 2014
[INFO] Final Memory: 8M/240M
[INFO] ------------------------------------------------------------------------
ole@MKI:~/test2$ mvn clean
Warning: JAVA_HOME environment variable is not set.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test-maven 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ test-maven ---
[INFO] Deleting /home/ole/test2/target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.268s
[INFO] Finished at: Wed Dec 31 12:53:00 CST 2014
[INFO] Final Memory: 6M/240M
[INFO] ------------------------------------------------------------------------
Ole
On 12/31/2014 12:23 PM, Mark Eggers wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Ole,
>
> In one instance (have to check your mail again) there were no files to
> compile, so nothing bad happened.
>
> If you run mvn clean test, then the target directory will be removed
> and Maven will be forced to recompile everything.
>
> You should get the command line failure consistently then.
>
> - From your log that you posted:
>
> Warning: JAVA_HOME environment variable is not set.
>
> Also, can you run the following from the command line and see if it works?
>
> javac -version
>
> You should get the version of javac echoed. If not, you have a path
> problem.
>
> If you do, run the following command:
>
> which javac
>
> This should tell you where javac is installed. I don't know how
> alternatives / OpenJDK gets installed on Ubuntu (I use Fedora and
> Oracle's JDK), so I don't know if setting JAVA_HOME to javac's parent
> directory is appropriate.
>
> For example, on my system 'which javac' results in:
>
> /usr/java/bin/javac
>
> This means that javac is in /usr/java/bin, and the parent directory
> (/usr/java) is the value that JAVA_HOME is set to on my system. This
> is actually a link to where the current version of Java is installed
> on my system.
>
> One of these days I'll walk through alternatives and figure out if it
> meets my needs (or if I should file bug reports).
>
> . . . just my two cents
> /mde/
>
> On 12/31/2014 9:52 AM, Ole Ersoy wrote:
>> Hi Mark,
>>
>> I do have Open JDK installed. The reason this is strange is
>> because the maven build runs fine from the command line after the
>> project is run with Eclipse. Other maven builds I have also run
>> fine from the command line. For example if I git clone apache
>> commons math and run the build, it builds fine.
>>
>> In this case I'm just creating a very minimal project with: -
>> pom.xml - src/test/java/hello/HelloTest.java
>>
>> When I try to run the build, it fails. If I import it into
>> eclipse, it runs. When I try the build from the command line
>> again, it runs. If I create another project with the same set of
>> original resources, it fails all over again.
>>
>> Thoughts?
>>
>> Thanks again, Ole
>>
>>
>>
>> On 12/31/2014 11:17 AM, Mark Eggers wrote: On 12/31/2014 8:49 AM,
>> Ole Ersoy wrote:
>>>>> Hi,
>>>>>
>>>>> I'm seeing some strange behavior with Maven 3.0.5 on Ubuntu.
>>>>>
>>>>> BACKGROUND ===================== When I run `mvn test` the
>>>>> console prints: `[ERROR] No compiler is provided in this
>>>>> environment. Perhaps you are running on a JRE rather than a
>>>>> JDK?`
>>>>>
>>>>> If I then open the project in Eclipse and run the test it
>>>>> runs fine. Subsequently if I close Eclipse and run the test
>>>>> with `mvn test` I get `BUILD SUCCESS`.
>>>>>
>>>>> ANALYSIS ===================== I run `mvn test` on the
>>>>> `test2` project, that was opened with eclipse, and I get ->
>>>>> `BUILD SUCCESS`.
>>>>>
>>>>> I then create a `test3` project, copy the pom and the src
>>>>> directory from test2 to test 3. When running `mvn test` on
>>>>> the `test3` project I get the error again. I included the
>>>>> result from my console below:
>>>>>
>>>>> ole@MKI:~/test2$ mvn test Warning: JAVA_HOME environment
>>>>> variable is not set. [INFO] Scanning for projects... [INFO]
>>>>> [INFO]
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>>
> [INFO] Building test-maven 1.0.0
>>>>> [INFO]
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>>
> [INFO]
>>>>> [INFO] --- maven-resources-plugin:2.3:resources
>>>>> (default-resources) @ test-maven --- [WARNING] Using platform
>>>>> encoding (UTF-8 actually) to copy filtered resources, i.e.
>>>>> build is platform dependent! [INFO] skip non existing
>>>>> resourceDirectory /home/ole/test2/src/main/resources [INFO]
>>>>> [INFO] --- maven-compiler-plugin:3.2:compile
>>>>> (default-compile) @ test-maven --- [INFO] No sources to
>>>>> compile [INFO] [INFO] ---
>>>>> maven-resources-plugin:2.3:testResources
>>>>> (default-testResources) @ test-maven --- [WARNING] Using
>>>>> platform encoding (UTF-8 actually) to copy filtered
>>>>> resources, i.e. build is platform dependent! [INFO] skip non
>>>>> existing resourceDirectory /home/ole/test2/src/test/resources
>>>>> [INFO] [INFO] --- maven-compiler-plugin:3.2:testCompile
>>>>> (default-testCompile) @ test-maven --- [INFO] Nothing to
>>>>> compile - all classes are up to date [INFO] [INFO] ---
>>>>> maven-surefire-plugin:2.10:test (default-test) @ test-maven
>>>>> --- [INFO] Surefire report directory:
>>>>> /home/ole/test2/target/surefire-reports
>>>>>
>>>>> ------------------------------------------------------- T E S
>>>>> T S -------------------------------------------------------
>>>>> Running hello.HelloUnitTest Greeting from hello the Unit
>>>>> Test! Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time
>>>>> elapsed: 0.039 sec
>>>>>
>>>>> Results :
>>>>>
>>>>> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
>>>>>
>>>>> [INFO]
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>>
> [INFO] BUILD SUCCESS
>>>>> [INFO]
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>>
> [INFO] Total time: 1.027s
>>>>> [INFO] Finished at: Wed Dec 31 10:41:25 CST 2014 [INFO]
>>>>> Final Memory: 8M/240M [INFO]
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>>
> ole@MKI:~/test2$ mkdir ../test3
>>>>> ole@MKI:~/test2$ cp pom.xml ../test3 ole@MKI:~/test2$ cp -r
>>>>> src ../test3 ole@MKI:~/test2$ cd ../test3/ ole@MKI:~/test3$
>>>>> mvn test Warning: JAVA_HOME environment variable is not set.
>>>>> [INFO] Scanning for projects... [INFO] [INFO]
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>>
> [INFO] Building test-maven 1.0.0
>>>>> [INFO]
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>>
> [INFO]
>>>>> [INFO] --- maven-resources-plugin:2.3:resources
>>>>> (default-resources) @ test-maven --- [WARNING] Using platform
>>>>> encoding (UTF-8 actually) to copy filtered resources, i.e.
>>>>> build is platform dependent! [INFO] skip non existing
>>>>> resourceDirectory /home/ole/test3/src/main/resources [INFO]
>>>>> [INFO] --- maven-compiler-plugin:3.2:compile
>>>>> (default-compile) @ test-maven --- [INFO] No sources to
>>>>> compile [INFO] [INFO] ---
>>>>> maven-resources-plugin:2.3:testResources
>>>>> (default-testResources) @ test-maven --- [WARNING] Using
>>>>> platform encoding (UTF-8 actually) to copy filtered
>>>>> resources, i.e. build is platform dependent! [INFO] skip non
>>>>> existing resourceDirectory /home/ole/test3/src/test/resources
>>>>> [INFO] [INFO] --- maven-compiler-plugin:3.2:testCompile
>>>>> (default-testCompile) @ test-maven --- [INFO] Changes
>>>>> detected - recompiling the module! [WARNING] File encoding
>>>>> has not been set, using platform encoding UTF-8, i.e. build
>>>>> is platform dependent! [INFO] Compiling 1 source file to
>>>>> /home/ole/test3/target/test-classes [INFO]
>>>>> -------------------------------------------------------------
>>>>>
>>>>>
> [ERROR] COMPILATION ERROR : [INFO]
>>>>> -------------------------------------------------------------
>>>>>
>>>>>
> [ERROR] No compiler is provided in this environment. Perhaps you
>>>>> are running on a JRE rather than a JDK? [INFO] 1 error
>>>>> [INFO]
>>>>> -------------------------------------------------------------
>>>>>
>>>>>
> [INFO]
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>>
> [INFO] BUILD FAILURE
>>>>> [INFO]
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>>
> [INFO] Total time: 0.722s
>>>>> [INFO] Finished at: Wed Dec 31 10:42:07 CST 2014 [INFO]
>>>>> Final Memory: 8M/303M [INFO]
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>>
> [ERROR] Failed to execute goal
>>>>> org.apache.maven.plugins:maven-compiler-plugin:3.2:testCompile
>>>>>
>>>>>
> (default-testCompile) on project test-maven: Compilation failure
>>>>> [ERROR] No compiler is provided in this environment. Perhaps
>>>>> you are running on a JRE rather than a JDK? [ERROR] -> [Help
>>>>> 1] [ERROR] [ERROR] To see the full stack trace of the errors,
>>>>> re-run Maven with the -e switch. [ERROR] Re-run Maven using
>>>>> the -X switch to enable full debug logging. [ERROR] [ERROR]
>>>>> For more information about the errors and possible solutions,
>>>>> please read the following articles: [ERROR] [Help 1]
>>>>> http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
>>>>>
>>>>>
>>>>>
> ole@MKI:~/test3$ tree . ├── pom.xml ├── src │ └── test │
>>>>> └── java │ └── hello │ └──
>>>>> HelloUnitTest.java └── target ├── generated-test-sources │
>>>>> └── test-annotations ├── maven-status │ └──
>>>>> maven-compiler-plugin │ └── testCompile │ └──
>>>>> default-testCompile │ ├── createdFiles.lst │
>>>>> └── inputFiles.lst └── test-classes
>>>>>
>>>>> 12 directories, 4 files
>>>>>
>>>>> Thoughts (Besides just open it in Eclipse :) )?
>>>>>
>>>>> TIA, - Ole
>> Eclipse comes with its own compiler, so it only needs the JRE to
>> run.
>>
>> The command line needs the JDK, which you don't have installed.
>>
>> Install the JDK, set $JAVA_HOME, and make sure $JAVA_HOME/bin is
>> on your path.
>>
>> See the bottom of the following page for detailed instructions:
>>
>> http://maven.apache.org/download.cgi
>>
>> If you're uncomfortable about using a different Java version
>> between command line and Eclipse, you can always point Eclipse to
>> the JRE inside the JDK and use that as the default JRE for Eclipse
>> and the IDE.
>>
>> . . . just my two cents /mde/
>>
>>> --- This email is free from viruses and malware because avast!
>>> Antivirus protection is active. http://www.avast.com
>>>
>>>
>>> ---------------------------------------------------------------------
>>>
>>>
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>>
>>
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
>
> iQEcBAEBAgAGBQJUpD8EAAoJEEFGbsYNeTwtV88H/0Eb/gERrruj44Ka5AGYqfFI
> MFllzBPORmlWlD/ZpI9b4rEbpx8e3vyCURqPayWnquMTFfyg4HxXAf3mhyT3c5c0
> eY+ire0ClYZH514UvdgQHAMyuek/JXt5CuPFu9yEBJHVV5PTiJUMTRz0dzE4I4Ap
> xj0/rO9zhriZnL1bFUC7zfTCSDhv6/qz2UmMTz6aod+w+J6OFa4KOTQ2Sg1FKUKx
> CIaLqTVFMzkgorgFi3SpT0LM3nxrOT8ArzFbCJI/kWBknuN+qZGA8OvP/iK/t8jU
> KrgU45GPe3lijQ8ZUmxWbHoAr7Wzp4tr8CJpNfSRYxLhXU/Im34IqoZ+WbSMrgk=
> =7+DE
> -----END PGP SIGNATURE-----
>
> ---
> This email is free from viruses and malware because avast! Antivirus protection is active.
> http://www.avast.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
> .
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Strange Issue
Posted by Bernd Eckenfels <ec...@zusammenkunft.net>.
Hello,
you can use "mvn -version" to see which java is used.
Gruss
Bernd
Am Wed, 31 Dec 2014 10:23:00 -0800
schrieb Mark Eggers <it...@yahoo.com.INVALID>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Ole,
>
> In one instance (have to check your mail again) there were no files to
> compile, so nothing bad happened.
>
> If you run mvn clean test, then the target directory will be removed
> and Maven will be forced to recompile everything.
>
> You should get the command line failure consistently then.
>
> - From your log that you posted:
>
> Warning: JAVA_HOME environment variable is not set.
>
> Also, can you run the following from the command line and see if it
> works?
>
> javac -version
>
> You should get the version of javac echoed. If not, you have a path
> problem.
>
> If you do, run the following command:
>
> which javac
>
> This should tell you where javac is installed. I don't know how
> alternatives / OpenJDK gets installed on Ubuntu (I use Fedora and
> Oracle's JDK), so I don't know if setting JAVA_HOME to javac's parent
> directory is appropriate.
>
> For example, on my system 'which javac' results in:
>
> /usr/java/bin/javac
>
> This means that javac is in /usr/java/bin, and the parent directory
> (/usr/java) is the value that JAVA_HOME is set to on my system. This
> is actually a link to where the current version of Java is installed
> on my system.
>
> One of these days I'll walk through alternatives and figure out if it
> meets my needs (or if I should file bug reports).
>
> . . . just my two cents
> /mde/
>
> On 12/31/2014 9:52 AM, Ole Ersoy wrote:
> > Hi Mark,
> >
> > I do have Open JDK installed. The reason this is strange is
> > because the maven build runs fine from the command line after the
> > project is run with Eclipse. Other maven builds I have also run
> > fine from the command line. For example if I git clone apache
> > commons math and run the build, it builds fine.
> >
> > In this case I'm just creating a very minimal project with: -
> > pom.xml - src/test/java/hello/HelloTest.java
> >
> > When I try to run the build, it fails. If I import it into
> > eclipse, it runs. When I try the build from the command line
> > again, it runs. If I create another project with the same set of
> > original resources, it fails all over again.
> >
> > Thoughts?
> >
> > Thanks again, Ole
> >
> >
> >
> > On 12/31/2014 11:17 AM, Mark Eggers wrote: On 12/31/2014 8:49 AM,
> > Ole Ersoy wrote:
> >>>> Hi,
> >>>>
> >>>> I'm seeing some strange behavior with Maven 3.0.5 on Ubuntu.
> >>>>
> >>>> BACKGROUND ===================== When I run `mvn test` the
> >>>> console prints: `[ERROR] No compiler is provided in this
> >>>> environment. Perhaps you are running on a JRE rather than a
> >>>> JDK?`
> >>>>
> >>>> If I then open the project in Eclipse and run the test it
> >>>> runs fine. Subsequently if I close Eclipse and run the test
> >>>> with `mvn test` I get `BUILD SUCCESS`.
> >>>>
> >>>> ANALYSIS ===================== I run `mvn test` on the
> >>>> `test2` project, that was opened with eclipse, and I get ->
> >>>> `BUILD SUCCESS`.
> >>>>
> >>>> I then create a `test3` project, copy the pom and the src
> >>>> directory from test2 to test 3. When running `mvn test` on
> >>>> the `test3` project I get the error again. I included the
> >>>> result from my console below:
> >>>>
> >>>> ole@MKI:~/test2$ mvn test Warning: JAVA_HOME environment
> >>>> variable is not set. [INFO] Scanning for projects... [INFO]
> >>>> [INFO]
> >>>> ------------------------------------------------------------------------
> >>>>
> >>>>
> >
> >>>>
> [INFO] Building test-maven 1.0.0
> >>>> [INFO]
> >>>> ------------------------------------------------------------------------
> >>>>
> >>>>
> >
> >>>>
> [INFO]
> >>>> [INFO] --- maven-resources-plugin:2.3:resources
> >>>> (default-resources) @ test-maven --- [WARNING] Using platform
> >>>> encoding (UTF-8 actually) to copy filtered resources, i.e.
> >>>> build is platform dependent! [INFO] skip non existing
> >>>> resourceDirectory /home/ole/test2/src/main/resources [INFO]
> >>>> [INFO] --- maven-compiler-plugin:3.2:compile
> >>>> (default-compile) @ test-maven --- [INFO] No sources to
> >>>> compile [INFO] [INFO] ---
> >>>> maven-resources-plugin:2.3:testResources
> >>>> (default-testResources) @ test-maven --- [WARNING] Using
> >>>> platform encoding (UTF-8 actually) to copy filtered
> >>>> resources, i.e. build is platform dependent! [INFO] skip non
> >>>> existing resourceDirectory /home/ole/test2/src/test/resources
> >>>> [INFO] [INFO] --- maven-compiler-plugin:3.2:testCompile
> >>>> (default-testCompile) @ test-maven --- [INFO] Nothing to
> >>>> compile - all classes are up to date [INFO] [INFO] ---
> >>>> maven-surefire-plugin:2.10:test (default-test) @ test-maven
> >>>> --- [INFO] Surefire report directory:
> >>>> /home/ole/test2/target/surefire-reports
> >>>>
> >>>> ------------------------------------------------------- T E S
> >>>> T S -------------------------------------------------------
> >>>> Running hello.HelloUnitTest Greeting from hello the Unit
> >>>> Test! Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time
> >>>> elapsed: 0.039 sec
> >>>>
> >>>> Results :
> >>>>
> >>>> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
> >>>>
> >>>> [INFO]
> >>>> ------------------------------------------------------------------------
> >>>>
> >>>>
> >
> >>>>
> [INFO] BUILD SUCCESS
> >>>> [INFO]
> >>>> ------------------------------------------------------------------------
> >>>>
> >>>>
> >
> >>>>
> [INFO] Total time: 1.027s
> >>>> [INFO] Finished at: Wed Dec 31 10:41:25 CST 2014 [INFO]
> >>>> Final Memory: 8M/240M [INFO]
> >>>> ------------------------------------------------------------------------
> >>>>
> >>>>
> >
> >>>>
> ole@MKI:~/test2$ mkdir ../test3
> >>>> ole@MKI:~/test2$ cp pom.xml ../test3 ole@MKI:~/test2$ cp -r
> >>>> src ../test3 ole@MKI:~/test2$ cd ../test3/ ole@MKI:~/test3$
> >>>> mvn test Warning: JAVA_HOME environment variable is not set.
> >>>> [INFO] Scanning for projects... [INFO] [INFO]
> >>>> ------------------------------------------------------------------------
> >>>>
> >>>>
> >
> >>>>
> [INFO] Building test-maven 1.0.0
> >>>> [INFO]
> >>>> ------------------------------------------------------------------------
> >>>>
> >>>>
> >
> >>>>
> [INFO]
> >>>> [INFO] --- maven-resources-plugin:2.3:resources
> >>>> (default-resources) @ test-maven --- [WARNING] Using platform
> >>>> encoding (UTF-8 actually) to copy filtered resources, i.e.
> >>>> build is platform dependent! [INFO] skip non existing
> >>>> resourceDirectory /home/ole/test3/src/main/resources [INFO]
> >>>> [INFO] --- maven-compiler-plugin:3.2:compile
> >>>> (default-compile) @ test-maven --- [INFO] No sources to
> >>>> compile [INFO] [INFO] ---
> >>>> maven-resources-plugin:2.3:testResources
> >>>> (default-testResources) @ test-maven --- [WARNING] Using
> >>>> platform encoding (UTF-8 actually) to copy filtered
> >>>> resources, i.e. build is platform dependent! [INFO] skip non
> >>>> existing resourceDirectory /home/ole/test3/src/test/resources
> >>>> [INFO] [INFO] --- maven-compiler-plugin:3.2:testCompile
> >>>> (default-testCompile) @ test-maven --- [INFO] Changes
> >>>> detected - recompiling the module! [WARNING] File encoding
> >>>> has not been set, using platform encoding UTF-8, i.e. build
> >>>> is platform dependent! [INFO] Compiling 1 source file to
> >>>> /home/ole/test3/target/test-classes [INFO]
> >>>> -------------------------------------------------------------
> >>>>
> >>>>
> [ERROR] COMPILATION ERROR : [INFO]
> >>>> -------------------------------------------------------------
> >>>>
> >>>>
> [ERROR] No compiler is provided in this environment. Perhaps you
> >>>> are running on a JRE rather than a JDK? [INFO] 1 error
> >>>> [INFO]
> >>>> -------------------------------------------------------------
> >>>>
> >>>>
> [INFO]
> >>>> ------------------------------------------------------------------------
> >>>>
> >>>>
> >
> >>>>
> [INFO] BUILD FAILURE
> >>>> [INFO]
> >>>> ------------------------------------------------------------------------
> >>>>
> >>>>
> >
> >>>>
> [INFO] Total time: 0.722s
> >>>> [INFO] Finished at: Wed Dec 31 10:42:07 CST 2014 [INFO]
> >>>> Final Memory: 8M/303M [INFO]
> >>>> ------------------------------------------------------------------------
> >>>>
> >>>>
> >
> >>>>
> [ERROR] Failed to execute goal
> >>>> org.apache.maven.plugins:maven-compiler-plugin:3.2:testCompile
> >>>>
> >>>>
> (default-testCompile) on project test-maven: Compilation failure
> >>>> [ERROR] No compiler is provided in this environment. Perhaps
> >>>> you are running on a JRE rather than a JDK? [ERROR] -> [Help
> >>>> 1] [ERROR] [ERROR] To see the full stack trace of the errors,
> >>>> re-run Maven with the -e switch. [ERROR] Re-run Maven using
> >>>> the -X switch to enable full debug logging. [ERROR] [ERROR]
> >>>> For more information about the errors and possible solutions,
> >>>> please read the following articles: [ERROR] [Help 1]
> >>>> http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
> >>>>
> >>>>
> >>>>
> ole@MKI:~/test3$ tree . ├── pom.xml ├── src │ └── test │
> >>>> └── java │ └── hello │ └──
> >>>> HelloUnitTest.java └── target ├── generated-test-sources │
> >>>> └── test-annotations ├── maven-status │ └──
> >>>> maven-compiler-plugin │ └── testCompile │ └──
> >>>> default-testCompile │ ├── createdFiles.lst │
> >>>> └── inputFiles.lst └── test-classes
> >>>>
> >>>> 12 directories, 4 files
> >>>>
> >>>> Thoughts (Besides just open it in Eclipse :) )?
> >>>>
> >>>> TIA, - Ole
> > Eclipse comes with its own compiler, so it only needs the JRE to
> > run.
> >
> > The command line needs the JDK, which you don't have installed.
> >
> > Install the JDK, set $JAVA_HOME, and make sure $JAVA_HOME/bin is
> > on your path.
> >
> > See the bottom of the following page for detailed instructions:
> >
> > http://maven.apache.org/download.cgi
> >
> > If you're uncomfortable about using a different Java version
> > between command line and Eclipse, you can always point Eclipse to
> > the JRE inside the JDK and use that as the default JRE for Eclipse
> > and the IDE.
> >
> > . . . just my two cents /mde/
> >
> >>
> >> --- This email is free from viruses and malware because avast!
> >> Antivirus protection is active. http://www.avast.com
> >>
> >>
> >> ---------------------------------------------------------------------
> >>
> >>
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> >
> >
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
>
> iQEcBAEBAgAGBQJUpD8EAAoJEEFGbsYNeTwtV88H/0Eb/gERrruj44Ka5AGYqfFI
> MFllzBPORmlWlD/ZpI9b4rEbpx8e3vyCURqPayWnquMTFfyg4HxXAf3mhyT3c5c0
> eY+ire0ClYZH514UvdgQHAMyuek/JXt5CuPFu9yEBJHVV5PTiJUMTRz0dzE4I4Ap
> xj0/rO9zhriZnL1bFUC7zfTCSDhv6/qz2UmMTz6aod+w+J6OFa4KOTQ2Sg1FKUKx
> CIaLqTVFMzkgorgFi3SpT0LM3nxrOT8ArzFbCJI/kWBknuN+qZGA8OvP/iK/t8jU
> KrgU45GPe3lijQ8ZUmxWbHoAr7Wzp4tr8CJpNfSRYxLhXU/Im34IqoZ+WbSMrgk=
> =7+DE
> -----END PGP SIGNATURE-----
>
> ---
> This email is free from viruses and malware because avast! Antivirus
> protection is active. http://www.avast.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Strange Issue
Posted by Mark Eggers <it...@yahoo.com.INVALID>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Ole,
In one instance (have to check your mail again) there were no files to
compile, so nothing bad happened.
If you run mvn clean test, then the target directory will be removed
and Maven will be forced to recompile everything.
You should get the command line failure consistently then.
- From your log that you posted:
Warning: JAVA_HOME environment variable is not set.
Also, can you run the following from the command line and see if it works?
javac -version
You should get the version of javac echoed. If not, you have a path
problem.
If you do, run the following command:
which javac
This should tell you where javac is installed. I don't know how
alternatives / OpenJDK gets installed on Ubuntu (I use Fedora and
Oracle's JDK), so I don't know if setting JAVA_HOME to javac's parent
directory is appropriate.
For example, on my system 'which javac' results in:
/usr/java/bin/javac
This means that javac is in /usr/java/bin, and the parent directory
(/usr/java) is the value that JAVA_HOME is set to on my system. This
is actually a link to where the current version of Java is installed
on my system.
One of these days I'll walk through alternatives and figure out if it
meets my needs (or if I should file bug reports).
. . . just my two cents
/mde/
On 12/31/2014 9:52 AM, Ole Ersoy wrote:
> Hi Mark,
>
> I do have Open JDK installed. The reason this is strange is
> because the maven build runs fine from the command line after the
> project is run with Eclipse. Other maven builds I have also run
> fine from the command line. For example if I git clone apache
> commons math and run the build, it builds fine.
>
> In this case I'm just creating a very minimal project with: -
> pom.xml - src/test/java/hello/HelloTest.java
>
> When I try to run the build, it fails. If I import it into
> eclipse, it runs. When I try the build from the command line
> again, it runs. If I create another project with the same set of
> original resources, it fails all over again.
>
> Thoughts?
>
> Thanks again, Ole
>
>
>
> On 12/31/2014 11:17 AM, Mark Eggers wrote: On 12/31/2014 8:49 AM,
> Ole Ersoy wrote:
>>>> Hi,
>>>>
>>>> I'm seeing some strange behavior with Maven 3.0.5 on Ubuntu.
>>>>
>>>> BACKGROUND ===================== When I run `mvn test` the
>>>> console prints: `[ERROR] No compiler is provided in this
>>>> environment. Perhaps you are running on a JRE rather than a
>>>> JDK?`
>>>>
>>>> If I then open the project in Eclipse and run the test it
>>>> runs fine. Subsequently if I close Eclipse and run the test
>>>> with `mvn test` I get `BUILD SUCCESS`.
>>>>
>>>> ANALYSIS ===================== I run `mvn test` on the
>>>> `test2` project, that was opened with eclipse, and I get ->
>>>> `BUILD SUCCESS`.
>>>>
>>>> I then create a `test3` project, copy the pom and the src
>>>> directory from test2 to test 3. When running `mvn test` on
>>>> the `test3` project I get the error again. I included the
>>>> result from my console below:
>>>>
>>>> ole@MKI:~/test2$ mvn test Warning: JAVA_HOME environment
>>>> variable is not set. [INFO] Scanning for projects... [INFO]
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>
>>>>
[INFO] Building test-maven 1.0.0
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>
>>>>
[INFO]
>>>> [INFO] --- maven-resources-plugin:2.3:resources
>>>> (default-resources) @ test-maven --- [WARNING] Using platform
>>>> encoding (UTF-8 actually) to copy filtered resources, i.e.
>>>> build is platform dependent! [INFO] skip non existing
>>>> resourceDirectory /home/ole/test2/src/main/resources [INFO]
>>>> [INFO] --- maven-compiler-plugin:3.2:compile
>>>> (default-compile) @ test-maven --- [INFO] No sources to
>>>> compile [INFO] [INFO] ---
>>>> maven-resources-plugin:2.3:testResources
>>>> (default-testResources) @ test-maven --- [WARNING] Using
>>>> platform encoding (UTF-8 actually) to copy filtered
>>>> resources, i.e. build is platform dependent! [INFO] skip non
>>>> existing resourceDirectory /home/ole/test2/src/test/resources
>>>> [INFO] [INFO] --- maven-compiler-plugin:3.2:testCompile
>>>> (default-testCompile) @ test-maven --- [INFO] Nothing to
>>>> compile - all classes are up to date [INFO] [INFO] ---
>>>> maven-surefire-plugin:2.10:test (default-test) @ test-maven
>>>> --- [INFO] Surefire report directory:
>>>> /home/ole/test2/target/surefire-reports
>>>>
>>>> ------------------------------------------------------- T E S
>>>> T S -------------------------------------------------------
>>>> Running hello.HelloUnitTest Greeting from hello the Unit
>>>> Test! Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time
>>>> elapsed: 0.039 sec
>>>>
>>>> Results :
>>>>
>>>> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
>>>>
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>
>>>>
[INFO] BUILD SUCCESS
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>
>>>>
[INFO] Total time: 1.027s
>>>> [INFO] Finished at: Wed Dec 31 10:41:25 CST 2014 [INFO]
>>>> Final Memory: 8M/240M [INFO]
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>
>>>>
ole@MKI:~/test2$ mkdir ../test3
>>>> ole@MKI:~/test2$ cp pom.xml ../test3 ole@MKI:~/test2$ cp -r
>>>> src ../test3 ole@MKI:~/test2$ cd ../test3/ ole@MKI:~/test3$
>>>> mvn test Warning: JAVA_HOME environment variable is not set.
>>>> [INFO] Scanning for projects... [INFO] [INFO]
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>
>>>>
[INFO] Building test-maven 1.0.0
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>
>>>>
[INFO]
>>>> [INFO] --- maven-resources-plugin:2.3:resources
>>>> (default-resources) @ test-maven --- [WARNING] Using platform
>>>> encoding (UTF-8 actually) to copy filtered resources, i.e.
>>>> build is platform dependent! [INFO] skip non existing
>>>> resourceDirectory /home/ole/test3/src/main/resources [INFO]
>>>> [INFO] --- maven-compiler-plugin:3.2:compile
>>>> (default-compile) @ test-maven --- [INFO] No sources to
>>>> compile [INFO] [INFO] ---
>>>> maven-resources-plugin:2.3:testResources
>>>> (default-testResources) @ test-maven --- [WARNING] Using
>>>> platform encoding (UTF-8 actually) to copy filtered
>>>> resources, i.e. build is platform dependent! [INFO] skip non
>>>> existing resourceDirectory /home/ole/test3/src/test/resources
>>>> [INFO] [INFO] --- maven-compiler-plugin:3.2:testCompile
>>>> (default-testCompile) @ test-maven --- [INFO] Changes
>>>> detected - recompiling the module! [WARNING] File encoding
>>>> has not been set, using platform encoding UTF-8, i.e. build
>>>> is platform dependent! [INFO] Compiling 1 source file to
>>>> /home/ole/test3/target/test-classes [INFO]
>>>> -------------------------------------------------------------
>>>>
>>>>
[ERROR] COMPILATION ERROR : [INFO]
>>>> -------------------------------------------------------------
>>>>
>>>>
[ERROR] No compiler is provided in this environment. Perhaps you
>>>> are running on a JRE rather than a JDK? [INFO] 1 error
>>>> [INFO]
>>>> -------------------------------------------------------------
>>>>
>>>>
[INFO]
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>
>>>>
[INFO] BUILD FAILURE
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>
>>>>
[INFO] Total time: 0.722s
>>>> [INFO] Finished at: Wed Dec 31 10:42:07 CST 2014 [INFO]
>>>> Final Memory: 8M/303M [INFO]
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>
>>>>
[ERROR] Failed to execute goal
>>>> org.apache.maven.plugins:maven-compiler-plugin:3.2:testCompile
>>>>
>>>>
(default-testCompile) on project test-maven: Compilation failure
>>>> [ERROR] No compiler is provided in this environment. Perhaps
>>>> you are running on a JRE rather than a JDK? [ERROR] -> [Help
>>>> 1] [ERROR] [ERROR] To see the full stack trace of the errors,
>>>> re-run Maven with the -e switch. [ERROR] Re-run Maven using
>>>> the -X switch to enable full debug logging. [ERROR] [ERROR]
>>>> For more information about the errors and possible solutions,
>>>> please read the following articles: [ERROR] [Help 1]
>>>> http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
>>>>
>>>>
>>>>
ole@MKI:~/test3$ tree . ├── pom.xml ├── src │ └── test │
>>>> └── java │ └── hello │ └──
>>>> HelloUnitTest.java └── target ├── generated-test-sources │
>>>> └── test-annotations ├── maven-status │ └──
>>>> maven-compiler-plugin │ └── testCompile │ └──
>>>> default-testCompile │ ├── createdFiles.lst │
>>>> └── inputFiles.lst └── test-classes
>>>>
>>>> 12 directories, 4 files
>>>>
>>>> Thoughts (Besides just open it in Eclipse :) )?
>>>>
>>>> TIA, - Ole
> Eclipse comes with its own compiler, so it only needs the JRE to
> run.
>
> The command line needs the JDK, which you don't have installed.
>
> Install the JDK, set $JAVA_HOME, and make sure $JAVA_HOME/bin is
> on your path.
>
> See the bottom of the following page for detailed instructions:
>
> http://maven.apache.org/download.cgi
>
> If you're uncomfortable about using a different Java version
> between command line and Eclipse, you can always point Eclipse to
> the JRE inside the JDK and use that as the default JRE for Eclipse
> and the IDE.
>
> . . . just my two cents /mde/
>
>>
>> --- This email is free from viruses and malware because avast!
>> Antivirus protection is active. http://www.avast.com
>>
>>
>> ---------------------------------------------------------------------
>>
>>
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
>
>
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQEcBAEBAgAGBQJUpD8EAAoJEEFGbsYNeTwtV88H/0Eb/gERrruj44Ka5AGYqfFI
MFllzBPORmlWlD/ZpI9b4rEbpx8e3vyCURqPayWnquMTFfyg4HxXAf3mhyT3c5c0
eY+ire0ClYZH514UvdgQHAMyuek/JXt5CuPFu9yEBJHVV5PTiJUMTRz0dzE4I4Ap
xj0/rO9zhriZnL1bFUC7zfTCSDhv6/qz2UmMTz6aod+w+J6OFa4KOTQ2Sg1FKUKx
CIaLqTVFMzkgorgFi3SpT0LM3nxrOT8ArzFbCJI/kWBknuN+qZGA8OvP/iK/t8jU
KrgU45GPe3lijQ8ZUmxWbHoAr7Wzp4tr8CJpNfSRYxLhXU/Im34IqoZ+WbSMrgk=
=7+DE
-----END PGP SIGNATURE-----
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Strange Issue
Posted by Ole Ersoy <ol...@gmail.com>.
Hi Mark,
I do have Open JDK installed. The reason this is strange is because the maven build runs fine from the command line after the project is run with Eclipse. Other maven builds I have also run fine from the command line. For example if I git clone apache commons math and run the build, it builds fine.
In this case I'm just creating a very minimal project with:
- pom.xml
- src/test/java/hello/HelloTest.java
When I try to run the build, it fails. If I import it into eclipse, it runs. When I try the build from the command line again, it runs. If I create another project with the same set of original resources, it fails all over again.
Thoughts?
Thanks again,
Ole
On 12/31/2014 11:17 AM, Mark Eggers wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 12/31/2014 8:49 AM, Ole Ersoy wrote:
>> Hi,
>>
>> I'm seeing some strange behavior with Maven 3.0.5 on Ubuntu.
>>
>> BACKGROUND ===================== When I run `mvn test` the console
>> prints: `[ERROR] No compiler is provided in this environment.
>> Perhaps you are running on a JRE rather than a JDK?`
>>
>> If I then open the project in Eclipse and run the test it runs
>> fine. Subsequently if I close Eclipse and run the test with `mvn
>> test` I get `BUILD SUCCESS`.
>>
>> ANALYSIS ===================== I run `mvn test` on the `test2`
>> project, that was opened with eclipse, and I get -> `BUILD
>> SUCCESS`.
>>
>> I then create a `test3` project, copy the pom and the src directory
>> from test2 to test 3. When running `mvn test` on the `test3`
>> project I get the error again. I included the result from my
>> console below:
>>
>> ole@MKI:~/test2$ mvn test Warning: JAVA_HOME environment variable
>> is not set. [INFO] Scanning for projects... [INFO] [INFO]
>> ------------------------------------------------------------------------
>>
>>
> [INFO] Building test-maven 1.0.0
>> [INFO]
>> ------------------------------------------------------------------------
>>
>>
> [INFO]
>> [INFO] --- maven-resources-plugin:2.3:resources (default-resources)
>> @ test-maven --- [WARNING] Using platform encoding (UTF-8 actually)
>> to copy filtered resources, i.e. build is platform dependent!
>> [INFO] skip non existing resourceDirectory
>> /home/ole/test2/src/main/resources [INFO] [INFO] ---
>> maven-compiler-plugin:3.2:compile (default-compile) @ test-maven
>> --- [INFO] No sources to compile [INFO] [INFO] ---
>> maven-resources-plugin:2.3:testResources (default-testResources) @
>> test-maven --- [WARNING] Using platform encoding (UTF-8 actually)
>> to copy filtered resources, i.e. build is platform dependent!
>> [INFO] skip non existing resourceDirectory
>> /home/ole/test2/src/test/resources [INFO] [INFO] ---
>> maven-compiler-plugin:3.2:testCompile (default-testCompile) @
>> test-maven --- [INFO] Nothing to compile - all classes are up to
>> date [INFO] [INFO] --- maven-surefire-plugin:2.10:test
>> (default-test) @ test-maven --- [INFO] Surefire report directory:
>> /home/ole/test2/target/surefire-reports
>>
>> ------------------------------------------------------- T E S T S
>> ------------------------------------------------------- Running
>> hello.HelloUnitTest Greeting from hello the Unit Test! Tests run:
>> 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.039 sec
>>
>> Results :
>>
>> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
>>
>> [INFO]
>> ------------------------------------------------------------------------
>>
>>
> [INFO] BUILD SUCCESS
>> [INFO]
>> ------------------------------------------------------------------------
>>
>>
> [INFO] Total time: 1.027s
>> [INFO] Finished at: Wed Dec 31 10:41:25 CST 2014 [INFO] Final
>> Memory: 8M/240M [INFO]
>> ------------------------------------------------------------------------
>>
>>
> ole@MKI:~/test2$ mkdir ../test3
>> ole@MKI:~/test2$ cp pom.xml ../test3 ole@MKI:~/test2$ cp -r src
>> ../test3 ole@MKI:~/test2$ cd ../test3/ ole@MKI:~/test3$ mvn test
>> Warning: JAVA_HOME environment variable is not set. [INFO] Scanning
>> for projects... [INFO] [INFO]
>> ------------------------------------------------------------------------
>>
>>
> [INFO] Building test-maven 1.0.0
>> [INFO]
>> ------------------------------------------------------------------------
>>
>>
> [INFO]
>> [INFO] --- maven-resources-plugin:2.3:resources (default-resources)
>> @ test-maven --- [WARNING] Using platform encoding (UTF-8 actually)
>> to copy filtered resources, i.e. build is platform dependent!
>> [INFO] skip non existing resourceDirectory
>> /home/ole/test3/src/main/resources [INFO] [INFO] ---
>> maven-compiler-plugin:3.2:compile (default-compile) @ test-maven
>> --- [INFO] No sources to compile [INFO] [INFO] ---
>> maven-resources-plugin:2.3:testResources (default-testResources) @
>> test-maven --- [WARNING] Using platform encoding (UTF-8 actually)
>> to copy filtered resources, i.e. build is platform dependent!
>> [INFO] skip non existing resourceDirectory
>> /home/ole/test3/src/test/resources [INFO] [INFO] ---
>> maven-compiler-plugin:3.2:testCompile (default-testCompile) @
>> test-maven --- [INFO] Changes detected - recompiling the module!
>> [WARNING] File encoding has not been set, using platform encoding
>> UTF-8, i.e. build is platform dependent! [INFO] Compiling 1 source
>> file to /home/ole/test3/target/test-classes [INFO]
>> -------------------------------------------------------------
>> [ERROR] COMPILATION ERROR : [INFO]
>> -------------------------------------------------------------
>> [ERROR] No compiler is provided in this environment. Perhaps you
>> are running on a JRE rather than a JDK? [INFO] 1 error [INFO]
>> -------------------------------------------------------------
>> [INFO]
>> ------------------------------------------------------------------------
>>
>>
> [INFO] BUILD FAILURE
>> [INFO]
>> ------------------------------------------------------------------------
>>
>>
> [INFO] Total time: 0.722s
>> [INFO] Finished at: Wed Dec 31 10:42:07 CST 2014 [INFO] Final
>> Memory: 8M/303M [INFO]
>> ------------------------------------------------------------------------
>>
>>
> [ERROR] Failed to execute goal
>> org.apache.maven.plugins:maven-compiler-plugin:3.2:testCompile
>> (default-testCompile) on project test-maven: Compilation failure
>> [ERROR] No compiler is provided in this environment. Perhaps you
>> are running on a JRE rather than a JDK? [ERROR] -> [Help 1]
>> [ERROR] [ERROR] To see the full stack trace of the errors, re-run
>> Maven with the -e switch. [ERROR] Re-run Maven using the -X switch
>> to enable full debug logging. [ERROR] [ERROR] For more information
>> about the errors and possible solutions, please read the following
>> articles: [ERROR] [Help 1]
>> http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
>>
>> ole@MKI:~/test3$ tree . ├── pom.xml ├── src │ └── test │
>> └── java │ └── hello │ └──
>> HelloUnitTest.java └── target ├── generated-test-sources │ └──
>> test-annotations ├── maven-status │ └── maven-compiler-plugin │
>> └── testCompile │ └── default-testCompile │
>> ├── createdFiles.lst │ └── inputFiles.lst └──
>> test-classes
>>
>> 12 directories, 4 files
>>
>> Thoughts (Besides just open it in Eclipse :) )?
>>
>> TIA, - Ole
> Eclipse comes with its own compiler, so it only needs the JRE to run.
>
> The command line needs the JDK, which you don't have installed.
>
> Install the JDK, set $JAVA_HOME, and make sure $JAVA_HOME/bin is on
> your path.
>
> See the bottom of the following page for detailed instructions:
>
> http://maven.apache.org/download.cgi
>
> If you're uncomfortable about using a different Java version between
> command line and Eclipse, you can always point Eclipse to the JRE
> inside the JDK and use that as the default JRE for Eclipse and the IDE.
>
> . . . just my two cents
> /mde/
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
>
> iQEcBAEBAgAGBQJUpC/HAAoJEEFGbsYNeTwtO2kIAKEr2DC7OZt2hNMDhpuXtPqF
> /XtQHTMRR6W0SFXXkCDe4tqa2mGpQLSNUjXYUoDyw9QqX0YiS/X4kZwsPZOSjvrV
> fyYccm48U1/njdS6yiWbeuDqVSHGvWfrf7vv1L+/j28YhI8ZxM9PaXXJ05iBECmW
> t88hDHHNJpewf9IkIED5EHyFhie+pLqh+nITtLdrKx70zUwr6nVVXDglfbUbAuMK
> LueQ8hGWeQdpaj98zo0BnJYpi2bIRQ7inLNOthRDgSBZkcRVWHln4Gv05UFt/vhP
> en924SAlSRrSenKub7HhWzI0GaGnSGSyf1TRY75za6zgSNWbGVieb36pFyoqYd4=
> =BFis
> -----END PGP SIGNATURE-----
>
> ---
> This email is free from viruses and malware because avast! Antivirus protection is active.
> http://www.avast.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Strange Issue
Posted by Mark Eggers <it...@yahoo.com.INVALID>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 12/31/2014 8:49 AM, Ole Ersoy wrote:
> Hi,
>
> I'm seeing some strange behavior with Maven 3.0.5 on Ubuntu.
>
> BACKGROUND ===================== When I run `mvn test` the console
> prints: `[ERROR] No compiler is provided in this environment.
> Perhaps you are running on a JRE rather than a JDK?`
>
> If I then open the project in Eclipse and run the test it runs
> fine. Subsequently if I close Eclipse and run the test with `mvn
> test` I get `BUILD SUCCESS`.
>
> ANALYSIS ===================== I run `mvn test` on the `test2`
> project, that was opened with eclipse, and I get -> `BUILD
> SUCCESS`.
>
> I then create a `test3` project, copy the pom and the src directory
> from test2 to test 3. When running `mvn test` on the `test3`
> project I get the error again. I included the result from my
> console below:
>
> ole@MKI:~/test2$ mvn test Warning: JAVA_HOME environment variable
> is not set. [INFO] Scanning for projects... [INFO] [INFO]
> ------------------------------------------------------------------------
>
>
[INFO] Building test-maven 1.0.0
> [INFO]
> ------------------------------------------------------------------------
>
>
[INFO]
> [INFO] --- maven-resources-plugin:2.3:resources (default-resources)
> @ test-maven --- [WARNING] Using platform encoding (UTF-8 actually)
> to copy filtered resources, i.e. build is platform dependent!
> [INFO] skip non existing resourceDirectory
> /home/ole/test2/src/main/resources [INFO] [INFO] ---
> maven-compiler-plugin:3.2:compile (default-compile) @ test-maven
> --- [INFO] No sources to compile [INFO] [INFO] ---
> maven-resources-plugin:2.3:testResources (default-testResources) @
> test-maven --- [WARNING] Using platform encoding (UTF-8 actually)
> to copy filtered resources, i.e. build is platform dependent!
> [INFO] skip non existing resourceDirectory
> /home/ole/test2/src/test/resources [INFO] [INFO] ---
> maven-compiler-plugin:3.2:testCompile (default-testCompile) @
> test-maven --- [INFO] Nothing to compile - all classes are up to
> date [INFO] [INFO] --- maven-surefire-plugin:2.10:test
> (default-test) @ test-maven --- [INFO] Surefire report directory:
> /home/ole/test2/target/surefire-reports
>
> ------------------------------------------------------- T E S T S
> ------------------------------------------------------- Running
> hello.HelloUnitTest Greeting from hello the Unit Test! Tests run:
> 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.039 sec
>
> Results :
>
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
>
> [INFO]
> ------------------------------------------------------------------------
>
>
[INFO] BUILD SUCCESS
> [INFO]
> ------------------------------------------------------------------------
>
>
[INFO] Total time: 1.027s
> [INFO] Finished at: Wed Dec 31 10:41:25 CST 2014 [INFO] Final
> Memory: 8M/240M [INFO]
> ------------------------------------------------------------------------
>
>
ole@MKI:~/test2$ mkdir ../test3
> ole@MKI:~/test2$ cp pom.xml ../test3 ole@MKI:~/test2$ cp -r src
> ../test3 ole@MKI:~/test2$ cd ../test3/ ole@MKI:~/test3$ mvn test
> Warning: JAVA_HOME environment variable is not set. [INFO] Scanning
> for projects... [INFO] [INFO]
> ------------------------------------------------------------------------
>
>
[INFO] Building test-maven 1.0.0
> [INFO]
> ------------------------------------------------------------------------
>
>
[INFO]
> [INFO] --- maven-resources-plugin:2.3:resources (default-resources)
> @ test-maven --- [WARNING] Using platform encoding (UTF-8 actually)
> to copy filtered resources, i.e. build is platform dependent!
> [INFO] skip non existing resourceDirectory
> /home/ole/test3/src/main/resources [INFO] [INFO] ---
> maven-compiler-plugin:3.2:compile (default-compile) @ test-maven
> --- [INFO] No sources to compile [INFO] [INFO] ---
> maven-resources-plugin:2.3:testResources (default-testResources) @
> test-maven --- [WARNING] Using platform encoding (UTF-8 actually)
> to copy filtered resources, i.e. build is platform dependent!
> [INFO] skip non existing resourceDirectory
> /home/ole/test3/src/test/resources [INFO] [INFO] ---
> maven-compiler-plugin:3.2:testCompile (default-testCompile) @
> test-maven --- [INFO] Changes detected - recompiling the module!
> [WARNING] File encoding has not been set, using platform encoding
> UTF-8, i.e. build is platform dependent! [INFO] Compiling 1 source
> file to /home/ole/test3/target/test-classes [INFO]
> -------------------------------------------------------------
> [ERROR] COMPILATION ERROR : [INFO]
> -------------------------------------------------------------
> [ERROR] No compiler is provided in this environment. Perhaps you
> are running on a JRE rather than a JDK? [INFO] 1 error [INFO]
> -------------------------------------------------------------
> [INFO]
> ------------------------------------------------------------------------
>
>
[INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
>
>
[INFO] Total time: 0.722s
> [INFO] Finished at: Wed Dec 31 10:42:07 CST 2014 [INFO] Final
> Memory: 8M/303M [INFO]
> ------------------------------------------------------------------------
>
>
[ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-compiler-plugin:3.2:testCompile
> (default-testCompile) on project test-maven: Compilation failure
> [ERROR] No compiler is provided in this environment. Perhaps you
> are running on a JRE rather than a JDK? [ERROR] -> [Help 1]
> [ERROR] [ERROR] To see the full stack trace of the errors, re-run
> Maven with the -e switch. [ERROR] Re-run Maven using the -X switch
> to enable full debug logging. [ERROR] [ERROR] For more information
> about the errors and possible solutions, please read the following
> articles: [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
>
> ole@MKI:~/test3$ tree . ├── pom.xml ├── src │ └── test │
> └── java │ └── hello │ └──
> HelloUnitTest.java └── target ├── generated-test-sources │ └──
> test-annotations ├── maven-status │ └── maven-compiler-plugin │
> └── testCompile │ └── default-testCompile │
> ├── createdFiles.lst │ └── inputFiles.lst └──
> test-classes
>
> 12 directories, 4 files
>
> Thoughts (Besides just open it in Eclipse :) )?
>
> TIA, - Ole
Eclipse comes with its own compiler, so it only needs the JRE to run.
The command line needs the JDK, which you don't have installed.
Install the JDK, set $JAVA_HOME, and make sure $JAVA_HOME/bin is on
your path.
See the bottom of the following page for detailed instructions:
http://maven.apache.org/download.cgi
If you're uncomfortable about using a different Java version between
command line and Eclipse, you can always point Eclipse to the JRE
inside the JDK and use that as the default JRE for Eclipse and the IDE.
. . . just my two cents
/mde/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQEcBAEBAgAGBQJUpC/HAAoJEEFGbsYNeTwtO2kIAKEr2DC7OZt2hNMDhpuXtPqF
/XtQHTMRR6W0SFXXkCDe4tqa2mGpQLSNUjXYUoDyw9QqX0YiS/X4kZwsPZOSjvrV
fyYccm48U1/njdS6yiWbeuDqVSHGvWfrf7vv1L+/j28YhI8ZxM9PaXXJ05iBECmW
t88hDHHNJpewf9IkIED5EHyFhie+pLqh+nITtLdrKx70zUwr6nVVXDglfbUbAuMK
LueQ8hGWeQdpaj98zo0BnJYpi2bIRQ7inLNOthRDgSBZkcRVWHln4Gv05UFt/vhP
en924SAlSRrSenKub7HhWzI0GaGnSGSyf1TRY75za6zgSNWbGVieb36pFyoqYd4=
=BFis
-----END PGP SIGNATURE-----
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org