background preloader

Java

Facebook Twitter

Install Oracle Java 7 in Ubuntu via PPA Repository. Update: Java 7 is no longer supported by Oracle.

Install Oracle Java 7 in Ubuntu via PPA Repository

The binaries are no longer available for download, but if you have an Oracle account, you can still download it after logging in. The Oracle Java 7 installer in this article will continue to work only if you manually download Oracle JDK 7 (version 7u80 for 32bit and 64bit or 7u60 for arm), place it in the /var/cache/oracle-jdk7-installer/ folder on your computer, then install "oracle-java7-installer" as explained below in this article.

We've previously written about installing Oracle JDK 7 in Ubuntu using a script with a GUI provided by Zenity. Some may find this method hard to use and also, it comes with GTK dependencies. Jersey (JAX-RS) implements a HTTP Basic Auth decoder. I recently play with a pretty nifty framework called Jersey, allowing to make REST application using annotations under Java.

Jersey (JAX-RS) implements a HTTP Basic Auth decoder

This framework (and other JAX-RS implementation) is a pretty well done framework, quite easy to use, and pretty interesting feature inside. I will describe here a HTTP Basic Auth using Jersey system. The HTTP Basic Auth allow to join, on each request, some login/password information to allow/disallow resources, regarding that authentification. If you follow the REST rules, you already know that REST application are stateless, which means that you must NEVER have a login phase before accessing resources : all login you have to do has to be done within the request (basically we will set a special HTTP header for that). In this case, Basic Auth is a usefull feature from HTTP protocol for doing that. I will describe here the Basic authentification, not the digest one. HTTP Basic Auth, principle Jersey, working with filter. Java web development tutorials. Discover the secrets of the Java Serialization API.

Oracle Technology Network > Java Software Downloads View All Downloads Top Downloads New Downloads What's New Java in the Cloud: Rapidly develop and deploy Java business applications in the cloud.

Discover the secrets of the Java Serialization API

Essential Links Developer Spotlight. Useful code samples. Untitled. By Matthew Ford, 1st January 2005 (revised 13th August 2009 to remove dead links)©2005-2009 Forward Computing and Control Pty.

untitled

Ltd. NSW AustraliaAll rights reserved. Abstract Introduction One of Java's claims to fame is that it was conceived from the start as a language that would support multi-threaded programming. The problems with stopping Threads were not the only problems the previous versions of Java had. Public void run() { // note the Thread.run() method is declared // NOT to throw any checked exceptions try { .... // some code here which might throw // a checked exception such as an IOException .. } catch (IOException ioex) { ioex.printStackTrace(); } } because it was not easy to let the rest of the program know that the thread had terminated with an exception. An Overview of RMI Applications (The Java™ Tutorials > RMI) RMI applications often comprise two separate programs, a server and a client.

An Overview of RMI Applications (The Java™ Tutorials > RMI)

A typical server program creates some remote objects, makes references to these objects accessible, and waits for clients to invoke methods on these objects. A typical client program obtains a remote reference to one or more remote objects on a server and then invokes methods on them. RMI provides the mechanism by which the server and the client communicate and pass information back and forth. Such an application is sometimes referred to as a distributed object application. Distributed object applications need to do the following: Locate remote objects.

64 Java questions for any job interview. 1.

64 Java questions for any job interview

Which of the following are valid definitions of an application’s main( ) method? A) public static void main();b) public static void main( String args );c) public static void main( String args[] );d) public static void main( Graphics g );e) public static boolean main( String args[] ); 2. Producer consumer in Java 2 : Producer Consumer « Threads  Jastor. Java - Le Keyword di Java (1/2) Qt Jambi. Building » Qt Jambi. Design with runtime class information. One of the cool things about Java's object model is that Java objects are "conscious": given a reference to an object, you can get information about that object's class.

Design with runtime class information

This "runtime class information" makes possible all kinds of interesting designs and implementation techniques. But how are we to use this capability? When I think about Java's support for runtime class information, two clichés come to my mind: 1. Information is power. In our case, runtime class information gives power to the programmer because he or she has more information to work with. 2. Alas, in our case, runtime class information can be abused in designs. Cobra: Java HTML Parser & Viewer (Open Source) Cobra: Getting Started This page provides an overview of the Cobra API and tips for getting started.

Cobra: Java HTML Parser & Viewer (Open Source)

Test Program. Java Tip 70: Create objects from jar files! In Java Tip 49, (coauthored with Arthur Choi) we learned how to extract Java resources from jar (Java Archive) and zip archives, and in Jack Harich's Java Tip 39, we learned how to create custom class loaders to load class files via the local filesystem or the network.

Java Tip 70: Create objects from jar files!

In this new Java Tip, we're going to put that knowledge to work, loading classes from jar files. Look Ma, no hands! Given the capabilities provided for us by Jack's MultiClassLoader and Arthur's JarResources classes, creating a new class loader to load class files from jar archives is about as easy as programming gets: The JarClassLoader subclasses MultiClassLoader, inheriting the tricky bits usually associated with writing a class loader.

It uses an instance of the JarResources class to extract the jar file contents. We create the instance of JarResources in the constructor (passing along the name of the jar archive file). Work it! Now, let's put our sweat equity to work, by creating a demo, or test application. And John D. Twitter4J.