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 6220247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:55:29+00:00 2026-05-24T07:55:29+00:00

On linux, I often launch and compile from the command line (java/javac) Though, Java

  • 0

On linux, I often launch and compile from the command line (java/javac)
Though, Java isn’t the only language I use – I use C++, and for that I have GCC. Because I have both java and GCC, for example, there are more than one instance of ‘javac’:

From the terminal, passing ‘javac’ with no arguments:

The program ‘javac’ can be found in the following packages:
* openjdk-6-jdk
* ecj
* gcj-4.4-jdk
* gcj-4.5-jdk
Try: sudo apt-get install

Is there a way to specify which package I want to use? Either per-command, or set a default? I would prefer not to remove one or the other.

Thanks –
Zac

  • 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-05-24T07:55:31+00:00Added an answer on May 24, 2026 at 7:55 am
      update-java-alternatives -s openjdk-6-jdk
    

    On Ubuntu there is a system called alternatvies installed, to switch between different implementations:

    update-java-alternatives
    
    man update-java-alternatives 
    

    shows the usage:

    NAME
           update-java-alternatives - update alternatives for jre/sdk installations
    
    SYNOPSIS
           update-java-alternatives [--jre] [--plugin] [-t|--test|-v|--verbose]
                 -l|--list [<jname>]
                 -s|--set <jname>
                 -a|--auto
                 -h|-?|--help
    

    If you get problems with swing, you should try sun-java, which you’re missing in your list. 🙂

    As ‘KindOfAutomatic suggests:

    alternatives --config java
    alternatives --config javac
    

    is the same thing in a different way. Instead of ‘java’, you can config your favorite editor, x-www-browser, pager and so on as well. Have a look at

    ls /etc/alternatives 
    

    to get an impression, what’s already done there.

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

Sidebar

Related Questions

GVim on linux I use :!some command inside Vim often. I've just switched from
When I Ctrl C my program on linux I often get output that looks
On my linux (Ubuntu 11.04) development machine. I often need to install libraries from
I often use simple Chinese phrases like 你好 to test that my code can
In Linux, what is the difference between /dev/ttyS0 and /dev/ttys0 ? I know that
Under Linux, my C++ application is using fork() and execv() to launch multiple instances
I often see __WIN32 , WIN32 or __WIN32__ . I assume that this depends
I have about 5 different heterogenous linux dedicated server which can run Java applications.
I use GDB to debug C/C++ programs very often, and I'm reasonably knowledgeable with
Though I rarely write C code, I often see it (mostly due to books

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.