You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Gintare Ragaisiene <gi...@gmail.com> on 2016/02/26 15:24:25 UTC

"Perhaps you are running on a JRE rather than a JDK?" error building with maven.

Hello

I want to use swagger-codegen on Ubuntu 14.04 LTS (OS type 64-bit). So I
downloaded the source code from
https://github.com/swagger-api/swagger-codegen/tree/v2.1.5 , unzipped it
and build with maven.

$ sudo mvn -e package

The error appears:
...
[INFO] Copying 438 resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 66 source files to
/home/user/ProgramFiles/swagger-codegen-2.1.5/modules/swagger-codegen/target/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]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Compilation failure
No compiler is provided in this environment. Perhaps you are running on a
JRE rather than a JDK?

[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.BuildFailureException: Compilation failure
No compiler is provided in this environment. Perhaps you are running on a
JRE rather than a JDK?

    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:715)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException:
Compilation failure
No compiler is provided in this environment. Perhaps you are running on a
JRE rather than a JDK?

    at
org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:745)
    at
org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:118)
    at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
    ... 17 more

------
"mvn -v" output is:
Apache Maven 2.2.1 (rdebian-14)
Java version: 1.8.0_71
Java home: /home/user/ProgramFiles/jdk1.8.0_71/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "3.19.0-49-generic" arch: "amd64" Family: "unix"


Thanks

Re: "Perhaps you are running on a JRE rather than a JDK?" error building with maven.

Posted by Nick Stolwijk <ni...@gmail.com>.
On Fri, Feb 26, 2016 at 3:24 PM, Gintare Ragaisiene <
gintare.ragaisiene@gmail.com> wrote:

> Java home: /home/user/ProgramFiles/jdk1.8.0_71/jre
>

You are using the JRE which is delivered with the JDK. Try setting your
JAVA_HOME and your PATH variables to the JDK bin directory instead of the
JRE bin directory.

Hth,

Nick Stolwijk

~~~ Try to leave this world a little better than you found it and, when
your turn comes to die, you can die happy in feeling that at any rate you
have not wasted your time but have done your best ~~~

Lord Baden-Powell

Re: "Perhaps you are running on a JRE rather than a JDK?" error building with maven.

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi,

i would recommend you to use Maven 3.X at least..and don't use Maven 2.X 
anymore..(cause it's End Of Life)...

Where does JAVA_HOME point to? to /home/user/ProgramFiles/jdk1.8.0_71/ 
or /home/user/ProgramFiles/jdk1.8.0_71/jre ?

Kind regards
Karl Heinz Marbaise
On 2/26/16 3:24 PM, Gintare Ragaisiene wrote:
> Hello
>
> I want to use swagger-codegen on Ubuntu 14.04 LTS (OS type 64-bit). So I
> downloaded the source code from
> https://github.com/swagger-api/swagger-codegen/tree/v2.1.5 , unzipped it
> and build with maven.
>
> $ sudo mvn -e package
>
> The error appears:
> ...
> [INFO] Copying 438 resources
> [INFO] [compiler:compile {execution: default-compile}]
> [INFO] Changes detected - recompiling the module!
> [INFO] Compiling 66 source files to
> /home/user/ProgramFiles/swagger-codegen-2.1.5/modules/swagger-codegen/target/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]
> ------------------------------------------------------------------------
> [ERROR] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Compilation failure
> No compiler is provided in this environment. Perhaps you are running on a
> JRE rather than a JDK?
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.BuildFailureException: Compilation failure
> No compiler is provided in this environment. Perhaps you are running on a
> JRE rather than a JDK?
>
>      at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:715)
>      at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
>      at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
>      at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
>      at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
>      at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
>      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
>      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
>      at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
>      at
> org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
>      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>      at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>      at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>      at java.lang.reflect.Method.invoke(Method.java:606)
>      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>      at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>      at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.compiler.CompilationFailureException:
> Compilation failure
> No compiler is provided in this environment. Perhaps you are running on a
> JRE rather than a JDK?
>
>      at
> org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:745)
>      at
> org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:118)
>      at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
>      at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
>      ... 17 more
>
> ------
> "mvn -v" output is:
> Apache Maven 2.2.1 (rdebian-14)
> Java version: 1.8.0_71
> Java home: /home/user/ProgramFiles/jdk1.8.0_71/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux" version: "3.19.0-49-generic" arch: "amd64" Family: "unix"
>
>
> Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org