rpural
Posts: 30
Joined: Fri Feb 24, 2012 2:30 pm
Location: Minnesota
Contact: Website

This may be a stupid question: Where is javac?? [OBSOLETE]

Mon Mar 04, 2013 5:38 pm

I have Java installed on my Pi; when I type java -version I get "OpenJDK Runtime Environment (IcedTea6 1.12.1) (6b27-1.12.1+rp1)

All well and good... But if I type "javac programname", I get "bash: javac: command not found". Was the compiler not included in the JDK? And, if not, then what package do I need to install to get it, as I've searched through apt and aptitude, and could not find anything that provided javac.

Any help would be appreciated.

Spid
Posts: 525
Joined: Sat Jan 19, 2013 12:47 pm

Re: This may be a stupid question: Where is javac??

Mon Mar 04, 2013 5:51 pm

I do not believe you have installed anything on the PI.

You may have installed JAVA on an Operating System, and depends on what Operating System the level of Java support !!!!!

http://javatester.org
I will always assume you are running Raspbian for desktop and Raspbmc for XMBC !

User avatar
xranby
Posts: 539
Joined: Sat Mar 03, 2012 10:02 pm
Contact: Website

Re: This may be a stupid question: Where is javac??

Mon Mar 04, 2013 5:54 pm

On Rasbian or Debian you get javac by installing the jdk package:
sudo apt-get install openjdk-7-jdk
or
sudo apt-get install openjdk-6-jdk
Last edited by xranby on Mon Mar 04, 2013 6:34 pm, edited 2 times in total.
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

User avatar
jackokring
Posts: 816
Joined: Tue Jul 31, 2012 8:27 am
Location: London, UK
Contact: ICQ

Re: This may be a stupid question: Where is javac??

Mon Mar 04, 2013 5:57 pm

Which javac gives me /usr/bin/javac. And javac gives me a help screen when used on its own. I installed java using sudo apt-get install default-jdk I think.
Pi[NFA]=B256R0USB CL4SD8GB Raspbian Stock.
Pi[Work]=A+256 CL4SD8GB Raspbian Stock.
My favourite constant 1.65056745028

Spid
Posts: 525
Joined: Sat Jan 19, 2013 12:47 pm

Re: This may be a stupid question: Where is javac??

Mon Mar 04, 2013 6:14 pm

IF you are using Raspbian "wheezy" latest version then from repositories:

openjdk-7-jre
openjdk-7-jre-headless
openjdk-7-jre-lib

http://packages.debian.org/wheezy/openjdk-7-jre


maybe also ?

icedtea-7-jre-jamvm
icedtea-7-plugin
java-common
Last edited by Spid on Mon Mar 04, 2013 6:16 pm, edited 2 times in total.
I will always assume you are running Raspbian for desktop and Raspbmc for XMBC !

User avatar
duberry
Posts: 379
Joined: Mon Jan 28, 2013 10:44 pm
Location: standing on a planet that's evolving. And revolving at nine hundred miles an hour

Re: This may be a stupid question: Where is javac??

Mon Mar 04, 2013 6:14 pm

edit

Code: Select all

 which javac
not much help unless u have installed and need abs path
Last edited by duberry on Tue Mar 12, 2013 9:55 am, edited 1 time in total.
lend me your arms, fast as thunderbolts, for a pillow on my journey.
If the environment was a bank, would it be too big to fail
so long; and thanks for all the pi

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: This may be a stupid question: Where is javac??

Tue Mar 05, 2013 12:31 pm

Just to (hopefully) clarify a bit...

Java comes usually in two different 'packaging versions':

- JRE (Runtime Environment, for running already compiled class files/jars, does not include javac)
- JDK (Development Kit, for compiling your own stuff)

To mix things up, note that even with the JDK installed (and making sure to invoke the java executable from the JDK) 'java -version' reports 'Runtime Environment'.

Looks to me like the OP installed 'only' a JRE and therefore there is no javac at all on the system... So 'which java' won't work - and that 'javatester.org' only checks for browser Java plugin :roll:

The 'magic word' for apt etc is (like xranby subtly with the bolding suggests) 'jdk'!

Also note that in addition to the OpenJDK, there is an Oracle Developer Preview also available http://www.savagehomeautomation.com/raspi-jdk8
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

rpural
Posts: 30
Joined: Fri Feb 24, 2012 2:30 pm
Location: Minnesota
Contact: Website

Re: This may be a stupid question: Where is javac??

Tue Mar 12, 2013 12:48 am

Installing the JFK did the trick.

Spid: I don't know why you chose to be so insulting; it's not appreciated.

Thanks to the others for your help.

Spid
Posts: 525
Joined: Sat Jan 19, 2013 12:47 pm

Re: This may be a stupid question: Where is javac??

Tue Mar 12, 2013 6:42 am

rpural wrote:Installing the JFK did the trick.

Spid: I don't know why you chose to be so insulting; it's not appreciated.

Thanks to the others for your help.
It is not insulting just educating that you can not install anything on the Pi, and is a factual statement, sorry if being educated makes you feel insulted :oops:

If you had stated the Operating System then comments would not of been made, I am fed up with Posters convinced they have installed anything on the Pi :twisted:
Attachments
RaspiModelB.JPG
RaspiModelB.JPG (4.57 KiB) Viewed 4248 times
I will always assume you are running Raspbian for desktop and Raspbmc for XMBC !

User avatar
duberry
Posts: 379
Joined: Mon Jan 28, 2013 10:44 pm
Location: standing on a planet that's evolving. And revolving at nine hundred miles an hour

Re: This may be a stupid question: Where is javac??

Tue Mar 12, 2013 10:01 am

rpural wrote:Installing the JFK did the trick.

Spid: I don't know why you chose to be so insulting; it's not appreciated.

Thanks to the others for your help.

the more information you provide about any problem

the more chance you have of a solution
lend me your arms, fast as thunderbolts, for a pillow on my journey.
If the environment was a bank, would it be too big to fail
so long; and thanks for all the pi

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26074
Joined: Sat Jul 30, 2011 7:41 pm

Re: This may be a stupid question: Where is javac??

Tue Mar 12, 2013 10:47 am

Spid wrote:
rpural wrote:Installing the JFK did the trick.

Spid: I don't know why you chose to be so insulting; it's not appreciated.

Thanks to the others for your help.
It is not insulting just educating that you can not install anything on the Pi, and is a factual statement, sorry if being educated makes you feel insulted :oops:

If you had stated the Operating System then comments would not of been made, I am fed up with Posters convinced they have installed anything on the Pi :twisted:
Second time in two days, Spid, that someone has commented on your postings. Please be polite, and if you cannot be polite, don't post. Its a pretty safe assumption to assume Raspbian is the OS in use, no need to keep complaining if people don't mention it.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

rpural
Posts: 30
Joined: Fri Feb 24, 2012 2:30 pm
Location: Minnesota
Contact: Website

Re: This may be a stupid question: Where is javac??

Wed Mar 13, 2013 5:44 pm

If you want to be picky, you can't install anything on a computer at all. You can only run programs.

You knew exactly what I meant, but chose to be disagreeable instead of helpful. I wasn't going to go through the whole 'installed Java on 2013-02 Debian Wheesy running on the Raspberry Pi' as that would have wasted everyone's time (except, obviously yours). The rest of your comment was simply rude and insulting, and completely useless for solving the problem at hand (as i suspect you are as well).

Next time, just move on to the next message without adding the snide comment.

Yeahboi
Posts: 21
Joined: Wed Mar 18, 2020 5:17 am

Re: This may be a stupid question: Where is javac??

Wed Mar 18, 2020 7:40 am

[email protected]:~ $ sudo apt-get install openjdk-7-jdk
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package openjdk-7-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'openjdk-7-jdk' has no installation candidate


oh god help what is this
Remember; I'm kind of an idiot when it comes to this.

mikerr
Posts: 2825
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: This may be a stupid question: Where is javac??

Wed Mar 18, 2020 10:08 am

You're replying to a post that is SEVEN YEARS AGO

Not surprisingly, openjdk is now on newer versions than 7

try jdk 11

Code: Select all

sudo apt-get install openjdk-11-jdk
Android app - Raspi Card Imager - download and image SD cards - No PC required !

Return to “Java”