Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8012195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:15:19+00:00 2026-06-04T19:15:19+00:00

I tried to mvn install and got this message: Compilation failure Unable to locate

  • 0

I tried to mvn install and got this message:

Compilation failure
Unable to locate the Javac Compiler in:
  /usr/lib/jvm/java-7-openjdk-amd64/jre/../lib/tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.

Well, there is an open jdk, I also downloaded another one. I tried to point JAVA_HOME to both, now it is set:

JAVA_HOME=/usr/lib/jvm/jdk1.7.0_03
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH

I also tried to choose one of those open with sudo update-alternatives --config java but got the same error with different jdk versions in it.

How can I fix that? Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T19:15:20+00:00Added an answer on June 4, 2026 at 7:15 pm

    it seems like your PATH is not picked up correctly… does the output of “echo $PATH” contain the directory where javac resides?
    I would suggest following:

    open terminal and do an:

    export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_03
    export PATH=$PATH:$JAVA_HOME/bin
    javac -version
    which javac
    

    if javac -version still does not work create a symlink in /usr/local/bin pointing to your javac binary:

    cd /usr/local/bin
    ln -s /usr/lib/jvm/jdk1.7.0_03/bin/javac javac
    

    this should get you up an running…
    an alternative is to try setting up java via your package management system (e.g. “apt-get install java” or sth. similar)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried using this: mvn dependency:get -DrepoUrl=http://myserver/artifactory -Dartifact=com.mypackage:my-package-name:1.0.0 However it just downloaded the pom.xml
How can I use source 5? I tried mvn -source 5 test but it
I tried doing a mvn dependency:tree and I get a tree of dependencies. My
Tried to search for this online and didn't get very far, so I'm asking
Tried this: $('.link').click(function(e) { $.getScript('http://www.google.com/uds/api?file=uds.js&amp;v=1.0', function() { $('body').append('<p>GOOGLE API (UDS) is loaded</p>'); }); return
I tried to install google salve http://code.google.com/p/salve/ by adding following statements in the project's
I've tried to run a Wicket app in an embedded Jetty, using this code:
When doing a mvn install I want to end up with 2 WAR files
I'm compiling an open source project with mvn install but ended up with java.lang.OutOfMemoryError:
mvn clean install works without any errors, but when i start tomcat6 i get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.