Java

Java Logo
Type Object-oriented programming language
Paradigm Multi-paradigm: generic, object-oriented (class-based), functional, imperative, reflective, concurrent
Designed by James Gosling
Developer Oracle Corporation (current), Sun Microsystems (original)
First appeared May 23, 1995
Typing discipline Static, strong, safe, nominative, manifest
Memory management Automatic garbage collection
Open Format? Yes (Java 1.3)
Free Format? Yes (Java 1.3)
Filename extensions .java .class .jar
Magic Number ?

    Java is a high-level, class-based, object-oriented programming language originally developed by James Gosling at Sun Microsystems (which has since merged into Oracle Corporation) based on an earlier project to develop a programming language for embedded cable television systems, and released in 1995 as a core component of Sun Microsystems' Java platform. There are 3 billion devices that runs Java, mostly phones, Blu-ray players, servers, and TV sets.

      The language derives much of its syntax from C and C++, but it has fewer low-level facilities than either of them. Java applications are typically compiled to bytecode (class file) that can run on any Java virtual machine (JVM) regardless of computer architecture.

Java is a general-purpose, concurrent, class-based, object-oriented language that is specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere" (WORA), meaning that code that runs on one platform does not need to be recompiled to run on another. The JAR format (zipped Java classes) is used by Java in addition to .jar and .class files. 

BD-J is based on Java ME, meaning it only uses Java 1.3 class files. Newer versions of the Java language are not compatible with BD-J.

Example Code from Blu-play.com by Mistalu
package com.bluplay.helloworld;

public class HelloWorld extends java.awt.Container implements javax.tv.xlet.Xlet {

  private org.havi.ui.HScene scene;
  private java.awt.Font font;

  public void initXlet(javax.tv.xlet.XletContext context) {
    setSize(1280, 720);
    scene = org.havi.ui.HSceneFactory.getInstance().getDefaultHScene();
    scene.add(this);
    scene.validate();
  }

  public void startXlet() {
    setVisible(true);
    scene.setVisible(true);
    repaint();
  }

  public void pauseXlet() {
    setVisible(false);
  }

  public void destroyXlet(boolean unconditional) {
    scene.remove(this);
    scene = null;
  }

  public void paint(java.awt.Graphics g) {
    g.setColor(new java.awt.Color(0x000000));
    g.fillRect(0, 0, getWidth(), getHeight());
    g.setColor(new java.awt.Color(0xffffff));
    if (font == null) {
      font = new java.awt.Font(null, java.awt.Font.PLAIN, 30);
      g.setFont(font);
    }
    g.drawString("Hello World!", 50, 50);
  }
}

 

Java 1.3

Learning Version 1.3 of the Java programming language is necessary for BD-J development. BD-J is built on an older version of Java—specifically Java 1.3-level language features and class file format. It uses the Java ME (Micro Edition) platform, under the Personal Basis Profile (PBP) of the Connected Device Configuration (CDC), as defined in the Globally Executable MHP (GEM) standard adopted by the Blu-ray Disc Association.

This means:

  • You get core Java syntax and object-oriented programming from the late 90s/early 2000s era.

  • No modern features are allowed: no enums, no generics, no lambdas, no var keyword, no try-with-resources, no autoboxing/unboxing in some contexts, etc.

  • BD-J apps aren't regular Java programs with a public static void main(String[] args) method. Instead, they are Xlets—special modular applications with a defined lifecycle (Loaded → Paused → Active → Destroyed) managed by the player.

  • Output isn't to a console (no visible System.out.println() on a TV screen). You display text, graphics, and UI using the HAVi (Home Audio/Video Interoperability) framework (org.havi.ui.*) or BD-specific packages like org.bluray.*

  • The environment is heavily sandboxed for security: apps run with restricted permissions unless the JAR is properly signed, and access to storage, network, or advanced media is limited and player-dependent.

This keeps BD-J compatible across a huge range of Blu-ray hardware from 2006 onward, but it also means you need to think "embedded" and "constrained device" when coding, perfect for fancy movie applications or retro-style video games.

Java can feel moderately challenging as a first programming language for complete beginners due to its strict syntax and object-oriented focus, but with patience and good resources, most people start building simple programs comfortably within 3–6 months.


Book Recommendations

Since BD-J sticks to Java 1.3 fundamentals (no post-1.3 features), focus on late-90s/early-2000s books that teach clean core Java. These match the language level perfectly and help with OOP, threads, and basics needed for Xlets.


Book Description ISBN
Beginning Java 2 - JDK 1.3 Edition by Ivor Horton (2000)

The best pure-language tutorial for exactly JDK 1.3. Comprehensive, beginner-to-intermediate, with exercises—ideal before BD-J specifics.
1-86100-366-8 / 978-1861003669

Java in a Nutshell: A Desktop Quick Reference (1st edition, 1996 by David Flanagan, or 2nd/3rd editions (~1997–2000)

Classic O'Reilly concise reference. Great for quick lookups on syntax/APIs without modern fluff. 90s vibe, fully compatible.

1-56592-183-6

Learning Java (early editions ~2000–2002 by Patrick Niemeyer & Jonathan Knudsen, e.g., 2nd ed.

O'Reilly tutorial-style intro with practical examples; covers Java 2 era but stays close to 1.3.

0-596-00285-8
Java Network Programming, 2nd Edition by Elliotte Rusty Harold, O'Reilly, (2000) is relevant for advanced BD-J networking specifically, as it dives deep into those exact java.net APIs (sockets, UDP/TCP, I/O for networks, RMI, etc.) compatible with BD-J's constraints, no post-1.3 features needed. This is optional.  1-56592-870-9 / 978-1565928701

Programming HD DVD and Blu-ray Disc: The HD Cookbook🔗by Michael Zink, Philip C. Starner, and Bill Foote (2008)  

This is the official companion book to the open-source HDCookbook project. It provides in-depth coverage of authoring interactive content for both HD DVD (Advanced Content) and Blu-ray Disc (BD-J), including Java programming specifics for BD-J Xlets, HAVi UI, GRIN framework, media playback, disc structure, tools for creating disc images, and practical examples/code. It's the closest thing to a comprehensive guide for BD-J application development, though it's a little dated and focuses more on professional authoring than pure homebrew. The associated HDCookbook open-source repo (archived on GitHub🔗) offers the actual code samples and tools referenced in the book.

See Errata for corrections

978-0071496704 (or 007149670X for hardcover)



References


Author(s) : Æ Firestone

on Tuesday, March 19, 2024 | , | A comment?
0 responses to “Java”

Leave a Reply

Popular Pages