The Java virtual machine in Java

Create QR-Code in Java The Java virtual machine
123 The Java virtual machine
Paint Quick Response Code In Java
Using Barcode creation for Java Control to generate, create QR Code image in Java applications.
Another reason that Java implements byte-codes is that the Java system relies on a virtual machine (VM) The idea of a VM is that a virtual computer is specified and the programming language is written to access the logical functions and devices of the virtual machine Then, each platform which implements the VM specification is responsible for translating the functions and devices of the VM into native support So, for example, a Java VM for the Sun Solaris is responsible for mapping the graphics primitives from the Graphics class to the local system libraries 1231 The basics of a virtual machine The idea of a VM is one which has intermittently appeared in computing, perhaps the most successful example being the UCSD Pascal system The benefits of using a VM is that it enables the Java system
Make Barcode In Java
Using Barcode creation for Java Control to generate, create bar code image in Java applications.
to be be ported to a large number of platforms by simply outlining the functions of the byte-codes and leaving the implementation details to the software engineers Because the Java machine implements a set of logical or virtual services and devices, there is no need for the Java language to supply libraries for specific types of device (for example, network cards) or to cater for the internal dependencies of specific platforms (for example, byte ordering) The specification for the Java VM lays out the abstract specification and it is then the job of each implementer to translate this correctly The use of a VM provides a common development environment which is consistent across software and hardware systems, allowing both the developer and the user to deal with a single, common system and avoiding the complexities of moving between disparate platforms Java includes a full VM specification which is precise enough to outline what functions Java implementations should support, but also avoids specifying exactly how these functions should be implemented By leaving the details to the developers of the Java ports there is a greater scope for Java systems to take full advantage of client platforms without the restrictive influence of an overly detailed specification It also enables the developer to implement Java functions independently of Sun and allows the differentiation of commercial Java ports; this is sure to be good for the life of Java in the long run Is it a good idea to allow developers loose with something so important There are good and bad sides to this The bad side is that there is no guarantee that all of the features will be implemented correctly at least until some standard test suites are produced which facilitate exhaustive analysis But it is good that the specification is sufficiently open to encourage innovation and competition, two things which will benefit the Java community in the medium to long term The presence of such a thoughtful and open specification should also serve to allay fears that Sun wish to exclusively control the deployment and future of Java since, as the number of independent ports of the Java system increases, the amount of control that Sun and SunLabs can have on the language diminishes 1232 The downside of a virtual machine There are costs associated with using a virtual machine Firstly, if the VM is being designed to run across several platforms there is a tendency for the specification to gravitate towards the lowest common denominator For example, if the VM were initially intended to run on high-end 3-D workstations as well as low-end PCs, the specification will realistically have to dispense with the additional functionality offered by the workstations in favour of specifying a set of features which the PCs can implement as well after all, there is no value in a VM which is too restrictive in terms of requirements, because no one will implement a port Secondly, there is little scope for change or adapting new features into the VM As an example, the Java VM specification does not include any built-in support for 3-D graphics This effectively means that until the Java language is extended to support 3-D graphics in the core language set, Java cannot be effectively used for complex 3-D graphics applications Also, because the Java language and VM specifications will be implemented on a wide range of platforms, unless all platforms can support 3-D either the support will not be added or some platforms will no longer be supported by Java both of which would be far from ideal Native methods Java tries to solve this problem by supporting native methods Native methods are Java instance methods or class methods which are written in a language other than Java, for example C or C++ The native method is declared in the Java code and then developed in another language Dynamically loaded libraries are used to load the code into the Java environment space; the header files are generated for the target language from the Java code in order to facilitate the passing of arguments The advantage of using native methods is that it addresses the inherently static nature of the Java VM by allowing developers to write external code which can take advantage of new system features which were not incorporated in the Java language Native methods can also be used to access system libraries which may not be available to the Java system, perhaps accessing some system specific features that are not supported on other platforms Native methods can also be used to increase perform-
Decoding Barcode In Java
Using Barcode scanner for Java Control to read, scan read, scan image in Java applications.
ance in the absence of a full compiler, especially for computationally intensive code which spends large periods of time in complex loops The performance benefit comes from the fact that the native methods have been fully compiled into machine code and will consequently run at full speed As with everything, though, the use of native methods entails a cost In the case of Java, native methods are not cross-platform because they are fully compiled binaries or machine code which have been built for a specific type of hardware running a specific version of the operating system If a development effort relies heavily on native methods for support, it is worth considering selecting another language for the project Java has many strengths, but it is our opinion that native methods should be considered a very short-term fix to address extendibility issues, and should not generally be used if a more flexible alternative is available Native methods erode so much of what is good about Java and require the developer to have prior knowledge of the hardware which is available at the client end The use of native code also reincarnates the problems associated with machine code which we touched on at the start of the chapter While native methods are in principle a good thing they should be used sparingly and avoided in order to preserve the aspects of Java which make for flexible platform-independent computing 1233 Using other programming languages to create byte-codes There is an active discussion at the moment about the possibility of using programming languages other than Java to generate compiled byte-codes which will run in the Java run-time interpreter Developers who have extensive experience in languages such as Smalltalk and C++ want to take advantage of the large potential user base for Java without having to learn a new language The logic of the argument is that since the Java compiler takes Java source code and translates it into platform-neutral byte-codes, it should be possible to write other compilers which take source code written in other languages and generate the same byte-codes These could then be passed to the Java run-time system embedded in Web browsers In principle, this is technically possible although challenging for the compiler designer The Java run-time system expects byte-codes that are related to the Java language This would mean mapping, say, all of the C++ libraries to equivalent Java packages and ensuring that all of the C++ types are mapped to Java types While it is possible to do this, it would result in a less functional version of C++ for use with the Java run-time system since, effectively, Java provides a subset of C++ in many respects Facilities such as multiple inheritance which are supported in C++, but not in Java, would have to resolved, as would access from C++ code to Java libraries installed in the Java distribution on the client machine However, if there is sufficient demand for this type of compiler, and therefore a sufficiently profitable market niche, then it is certain that some development houses will embark on creating such tools At the moment, we do not know of such efforts but, given that it is technically achievable, we fully expect such products to emerge as the user base for the Java run-time system increases
Drawing QR Code 2d Barcode In Visual C#
Using Barcode generator for .NET Control to generate, create QR Code JIS X 0510 image in VS .NET applications.
QR Code Generation In .NET Framework
Using Barcode drawer for ASP.NET Control to generate, create QR-Code image in ASP.NET applications.
Quick Response Code Printer In VB.NET
Using Barcode creator for .NET framework Control to generate, create QR-Code image in .NET framework applications.
Data Matrix 2d Barcode Creator In Java
Using Barcode creator for Java Control to generate, create Data Matrix image in Java applications.
Draw Code 128C In Java
Using Barcode drawer for Java Control to generate, create USS Code 128 image in Java applications.
Uniform Symbology Specification ITF Creation In Java
Using Barcode printer for Java Control to generate, create ANSI/AIM ITF 25 image in Java applications.
Painting Barcode In Visual Basic .NET
Using Barcode creator for .NET Control to generate, create bar code image in VS .NET applications.
Generate EAN13 In VS .NET
Using Barcode maker for ASP.NET Control to generate, create UPC - 13 image in ASP.NET applications.
Generate DataMatrix In .NET Framework
Using Barcode creator for Visual Studio .NET Control to generate, create Data Matrix image in .NET framework applications.