decoration decoration
Stories

GROKLAW
When you want to know more...
decoration
For layout only
Home
Archives
Site Map
Search
About Groklaw
Awards
Legal Research
Timelines
ApplevSamsung
ApplevSamsung p.2
ArchiveExplorer
Autozone
Bilski
Cases
Cast: Lawyers
Comes v. MS
Contracts/Documents
Courts
DRM
Gordon v MS
GPL
Grokdoc
HTML How To
IPI v RH
IV v. Google
Legal Docs
Lodsys
MS Litigations
MSvB&N
News Picks
Novell v. MS
Novell-MS Deal
ODF/OOXML
OOXML Appeals
OraclevGoogle
Patents
ProjectMonterey
Psystar
Quote Database
Red Hat v SCO
Salus Book
SCEA v Hotz
SCO Appeals
SCO Bankruptcy
SCO Financials
SCO Overview
SCO v IBM
SCO v Novell
SCO:Soup2Nuts
SCOsource
Sean Daly
Software Patents
Switch to Linux
Transcripts
Unix Books

Gear

Groklaw Gear

Click here to send an email to the editor of this weblog.


You won't find me on Facebook


Donate

Donate Paypal


No Legal Advice

The information on Groklaw is not intended to constitute legal advice. While Mark is a lawyer and he has asked other lawyers and law students to contribute articles, all of these articles are offered to help educate, not to provide specific legal advice. They are not your lawyers.

Here's Groklaw's comments policy.


What's New

STORIES
No new stories

COMMENTS last 48 hrs
No new comments


Sponsors

Hosting:
hosted by ibiblio

On servers donated to ibiblio by AMD.

Webmaster
To compile successfully: | 393 comments | Create New Account
Comments belong to whoever posts them. Please notify us of inappropriate comments.
To compile successfully:
Authored by: Anonymous on Friday, May 25 2012 @ 11:19 PM EDT
To compile your Java language program, you need to have .class files for
any packages/classes that are USED BY your program.

This means that programs written for a Java platform, need to be
compiled against the Java platform's packages. These are part of the
JDK (Java Development Kit) you get from Oracle, or more properly, they
are part of the JRE (Java Runtime Environment) which is a subpart of the
JDK. You need the JRE to run your Java platform program, too. The JRE
contains a Java VM as well as those class library packages.

If you are making an Android program, you would instead use Android's
SDK (I don't know what its called). You would compile with javac, but
using the Android class libraries instead of the JRE ones. Some 51
packages have the same APIs between the two, but the rest are different.
(You would use dex after the javac step).

To make a program that works on BOTH platforms without modifications,
you would have to make both platform's entry point in your program, and
limit yourself to using only APIs from those 51 packages, and not use
other APIs that only one of the two platforms supports. In theory you
could then use either platform's class library when compiling the source
code with javac, and the compiled .class files would run fine on either
platform (for Android you'd have to run them through dex too).

What's a far more plausible scenario though, is taking large chunks of
code from one platform, and porting them to the other platform (by
changing only the parts that relied on non-supported APIs). This is much
less work than rewriting them from scratch. Many useful libraries exist, or
could be written, which would be 95-99% compatible with both platforms
(imagine image or data compression libraries, video and speech codecs,
sound synthesis libraries, a 2D software rasterizer, or file-processing
libraries, or a scientific math library for things like sparse matrices... or a

statistics library, or computational geometry, or image processing libraries,
or thousands of other useful things of this sort--none of these would need
much of anything outside the 51 packages, and they might all be useful
on (and easily ported between) both Android and J2SE.

[ Reply to This | Parent | # ]

Groklaw © Copyright 2003-2013 Pamela Jones.
All trademarks and copyrights on this page are owned by their respective owners.
Comments are owned by the individual posters.

PJ's articles are licensed under a Creative Commons License. ( Details )