An Overview of Java Virtual Machines (JVMs) – Developer.com

I came upon a great article revealing concepts of using JAVA.  The following is an excerpt from the site Developer.com and is an excellent overview of coding thereof.

JVM (Java Virtual Machine) is an abstract computing model. Just like a real machine, it has its own instruction set, execution engine, and serves to manipulate memory areas at run time. The objective is to provide an execution environment for applications built to run on it. JVM interprets the instruction code and interacts with the underlying layers: the OS platform and hardware architecture for execution of the instructions and resource management. This article gives an overview of the JVM and how a Java program executes within it.

Virtual Machine

Virtual machines are basically non-physical computers built to provide an environment that serves a specific or sometimes a general purpose. It sounds very similar to an Emulator that emulates a hardware component which either is not present in the machine or cannot perform as per requirement. So, what we do is create software that pretends that the specific hardware component is actually present in the system by providing the services provided by the actual hardware in the form of software. Virtual machines use CPU virtualization to am extent, providing an interface to the real hardware issues. So, in essence, both provide a virtual environment or an abstraction of something which it is not. However, differences between them obvious as we dive deeper. Let’s not focus on their differences for now. The point is that they pose something that they are not. In the words of Popek and Goldberg in the article “Formal Requirements for Virtualizable Third Generation Architectures,” it is “an efficient, isolated duplicate of the real machine.”

Virtual Machines have types, induced by their needs and usages. One is called full virtualization, which behaves like a real machine. Others are a little subtler and more specific, like process virtualization. It is difficult to typify JVM to any particular genre because JVM virtualizes a CPU, has its own runtime environment and memory manager that work in collaboration with the underlying platform, garbage collector, and, of course, its band of class libraries infused as an intermediate bytecode and last, but not least, emulates machine registers, stacks, and so forth. In short, it is a playground of the essence of Java called bytecode transformed by the Java compiler. Bytecodes are practically machine code for the JVM which reinterprets them into native machine instructions.

Class File Format

Interestingly, JVM does not care about the Java language or any other programming language with respect to its semantics and syntactical structure. When it comes to executing a program, its primary interest lies in a particular file format called the class file format. The file format .class has nothing to do with object-oriented class structure defined in Java code. It is a .java file transformed into a *.class file by the compiler. JVM is ready to interpret class files; it does not matter what compiler is used create it as long as it creates a class file format. The Java compiler compiles a program into its equivalent class files. These class files actually contain half-compiled code called bytecode. It is called half compiled because bytecode is not directly executable, as are binary files created by the C/C++ compiler. It is meant to be fed into the JVM, which, in turn, interacts with the underlying platform to finally execute the instructions. The bytecode thus contains JVM instructions, a symbol table, and other ancillary information. A compiler that can produce bytecode according to the syntactic and structural constraints of the JVM is a candidate to be executed on JVM, irrespective of any language.

JVM Standpoint

Use Cases for Level 3: Adaptive Network Control Solutions

JVM places itself between the bytecode and the underlying platform. The platform comprises the operating system (OS) and the hardware. The OS and hardware architecture may vary in multiple machines, but the same Java program that ran on one will run on any other machines without even making a slightest change in the code. This is something unique about the languages that run on a virtual environment. For example, the difference between target code generated by other programming language compilers such as C++ in comparison to Java is that the C++ program needs to be recompiled by platform-specific compilers to make it compatible to run on varied architectures. Java code, on the other hand, does not need to make any changes because the bytecode produced by the Java compiler executes within the periphery of the JVM. As a result, it is the responsibility of the JVM to align with the underlying platform by reinterpreting the bytecode generated by the Java compiler. This means that, although the product of Java compiler may be platform independent, JVM is platform specific. The same JVM that is installed and works for one architecture may not work in other machine, unless, of course, two machines have the same architectural background.

JVM1
Figure 1: The JVM structure

What Are JRE and JDK, with Respect to JVM?

To run a Java program, we need JVM because it is the environment on which a bytecode executes. Oracle provides two products: JDK (Java Development Kit) and JRE (Java Runtime Environment). JRE is the basic software that we install to run a Java program. It is an implementation of the JVM, along with Java class libraries and other component parts that provide all the means to run a Java program. So, if we want to run a class file or bytecode, JRE is simply enough. JDK (Java Development Kit), on the other hand, is a superset of JRE. It contains everything JRE offers, including tools to create the class files such as a Java compiler, debuggers, and many other tools related to developing a Java program. So, if we want to create a class file (compile Java source code), what we need is JDK. Here is a screen capture from the Java API Documentation. Note the components that form JDK, JRE, and the core Java SE API library; this gives a fair idea what the contents of JRE and JDK could be.

JVM2
Figure 2: From the Java API documentation

Java provides Java Virtual Machine Specification, to get a complete idea about the working principles behind JVM. One can take the idea from there and can built one’s own JVM; it’s not an easy task, though. There are many JVMs available in the market. Some are free; some come with a commercial license.

Executing a Java Program in JVM

Each Java program that executes on the Java Runtime Environment creates an instance of JVM, within which it runs. The compiled Java classes are loaded into the environment along with other dependent classes on demand. This is done with the help of a module called Class loader.

JVM3
Figure 3: The Class loader module and its function

The Class loader does this job in three phases.

Firstly, it loads the program classes, along with standard Java classes that are bundled with JDK in the form of bytecode. The standard classes form the core API library of Java. The bootstrap begins by locating the core API libraries classes typically situated in jre/lib.

Secondly, the extension mechanism locates the external classes, such as new (optional) packages that are added to Java for development and execution purposes. The extension classes are usually located in jre/lib/ext. Sometimes, the extension classes are situated in other directories defined by the java.ext.dirs system property. The packages are in the form of JAR or ZIP extensions.

Thirdly, if the class is not found in the standard Java class or extension classes, it searches the CLASSPATH, which contains a list of locations in which the classes are stored. The system property java.class.path maps to the CLASSPATH environment variable.

The archive file formats, such as JAR or ZIP, are individual files that contain directories of other files, typically in a compressed format. For example, the standard classes used in a program are contained in the archive files rt.jar, which is installed with JDK.

Once the files are located and loaded, the class loader performs various functions, such as verification according to the JVM constraints, memory allocation, and initializes class variables with default values before invoking the constructor to set define variables of the element.

When the loading process finishes, the bytecode instructions are passed to the execution engine. JVM then interacts with the underlying OS with the help of native code that is bound to a particular JVM implementation of a specific platform. Note that actual implementation varies slightly according to the platform.

The heap in the data memory area is used for dynamic and temporary memory allocation. The classes and array objects are created in this area. The garbage collector reclaims the memory when the objects go out of scope.

The Java stack, called the stack frame, is used to store data in the local variable; partial results during different stages of method invocation. Each method invocation creates a stack frame.

The method area is basically a shared storage among JVM threads.

Registers are the emulated registers of the underlying machine and are primarily used for executing bytecode instruction. The PC register or the program counter is the primary register used for holding the address of the currently executing instruction.

Functions of JVM in a Nutshell

The function of JVM thus can be summed up as follows:

  • Loading: The process of loading classes with the help of class loader.
  • Linking: Linking the classes to submit to the JVM runtime for execution.
  • Initializing: Memory allocation and setting up values by invoking class initialization methods.

Conclusion

The greatest advantage of using a virtual machine running programming languages is that they are platform independent. The productivity resulting from such languages outweighs their performance trade-off in comparison to highly efficient languages such as C/C++. This article just gives a glimpse of JVM, and perhaps enough to begin understanding how JVM actually works.

 

Tags: Java, JVM, JDK, OS, compiler, Java Runtime Environment 1.7, java virtual machine, C/C++,bytecode, JRE, Java Development Kit

 

Posted in Computers | Leave a comment

Ubuntu (operating system) – Wikipedia

Ubuntu (/ʊˈbuːntʊ/ uu-boon-tuu)[11] is a Debian-based Linux operating system for personal computers, tablets and smartphones, where Ubuntu Touch edition is used; and also runs network servers, usually with the Ubuntu Server edition, either on physical or virtual servers (such as on mainframes) and/or with containers, that is with enterprise-class features; runs on the most popular architectures, including server-class ARM-based.

Ubuntu is published by Canonical Ltd, who offer commercial support.[12] It is based on free software and named after the Southern African philosophy of ubuntu (literally, ‘human-ness’), which Canonical Ltd. suggests can be loosely translated as “humanity to others” or “I am what I am because of who we all are”.[13] It uses Unity as its default user interface for the desktop.

Ubuntu is the most popular operating system running in hosted environments, so–called “clouds”,[14] as it is the most popular server Linux distribution.

Development of Ubuntu is led by UK-based Canonical Ltd., a company of South African entrepreneur Mark Shuttleworth. Canonical generates revenue through the sale of technical support and other services related to Ubuntu.[15][16] The Ubuntu project is publicly committed to the principles of open-source software development; people are encouraged to use free software, study how it works, improve upon it, and distribute it.[17][18]

via Ubuntu (operating system) – Wikipedia

Posted in Computers | Leave a comment

Microsoft PowerShell

via Microsoft PowerShell

Posted in Computers | Leave a comment

Visual Studio 2017 RC

Technologies
Documentation
Resources
Sign in
Search MicrosoftSearch
Visual Studio
Visual Studio IDE
Features
Offerings
Downloads
Support
Free Visual Studio
Subscriber Portal
Unparalleled productivity for any dev, any app, and any platform
Visual Studio 2017 Release Candidate
Free download
Release Notes
Boosted
productivity
Redefined
fundamentals
Streamlined Azure
development
Five-star mobile
development
Enhancements to code navigation, IntelliSense, refactoring, code fixes, and debugging, saves you time and effort on everyday tasks regardless of language or platform. For teams embracing DevOps, Visual Studio 2017 streamlines your inner loop and speeds up code flow with the brand new real time features such as live unit testing and real-time architectural dependency validation.

Only what you need:

via Visual Studio 2017 RC

Posted in Computers | Leave a comment

Create an Offline Installation of Visual Studio 2017 RC | Microsoft Docs

Create an offline installation of Visual Studio 2017 RC
12/7/2016 3 min to read Contributors all
Create a layout
If you want to install Visual Studio 2017 RC on another machine that doesn’t have internet access, you can do so by first creating an offline installation layout that contains all the Visual Studio files and components you need.

You can then install Visual Studio to the target machine by using the offline installation layout that you created.

Warning

Currently, the Android SDK does not support an offline installation experience. If you install Android SDK Setup items on a computer that is not connected to the internet, the installation might fail. For more information about this, go to the Troubleshoot an offline installation section in this topic.
To create an offline installation layout of Visual Studio
Download the Visual Studio setup executable file to a drive on your local machine. For example, download the vs_enterprise.exe file.
Run vs_enterprise.exe with the following arguments (switches) from a command prompt:

a. Add –layout <path>, where <path> is the location where you want the layout to download to. Note that relative paths (e.g. ..\vs2017) are not supported at present. By default, all languages are downloaded. (See Example A.)

Warning

Currently, an offline installation of Visual Studio 2017 RC will silently fail to install if the layout location is a root directory (for example, D:\). This is very common when an offline installation layout is created at the root of an ISO image. To work around this issue, please use a directory for the layout location. For example, use D:\VS2017.
b. Restrict the download to a subset of the available languages by providing the –lang <language> argument, where <language> is one or more of the ISO country codes. (See Example B and Example C.)

Examples

Example A: Install all languages

vs_enterprise.exe –layout C:\vs2017

Example B: Install one language

vs_enterprise.exe –layout C:\vs2017 –lang en-US

Example C: Install multiple languages

vs_enterprise.exe –layout C:\vs2017 –lang en-US de-DE ja-JP

via Create an Offline Installation of Visual Studio 2017 RC | Microsoft Docs

Posted in Computers | Leave a comment

PowerShell Gallery | Home

Welcome to the PowerShell Gallery
The PowerShell Gallery is the central repository for PowerShell content. You can find new PowerShell commands or Desired State Configuration (DSC) resources in the Gallery.

Getting Started with the Gallery
Installing items from the Gallery requires the latest version of the PowerShellGet module, which is available in Windows 10, in Windows Management Framework (WMF) 5.0, or in the MSI-based installer (for PowerShell 3 and 4).

Get Windows 10
Get latest WMF
Get PowerShellGet for PS 3 & 4
With the latest PowerShellGet module, you can:

Search through items in the Gallery with Find-Module and Find-Script
Save items to your system from the Gallery with Save-Module and Save-Script
Install items from the Gallery with Install-Module and Install-Script
Upload items to the Gallery with Publish-Module and Publish-Script
Add your own custom repository with Register-PSRepository
Check out the Documentation for more information on how to use PowerShellGet commands with the Gallery. You can also run Update-Help -Module PowerShellGet to install local help for these commands.

Download PS 3 & 4

via PowerShell Gallery | Home

Posted in Computers | Leave a comment

Microsoft Development Centers

Microsoft developer centers

Only Microsoft brings you a complete set of innovative platforms and technologies that help you shape the future. Whether you develop for mobile, desktop, or the cloud—you are always playing in a single universe of devices and services. It’s time to go exploring.

via Microsoft Development Centers

PLATFORM AND TOOLS

Find everything you need to develop on Microsoft platforms. Develop on all Windows devices, for all markets worldwide; use Azure to build a cloud-based backend; or develop productivity apps in their native environment locally or in the cloud.

Windows Hardware

Microsoft Azure

BUSINESS AND ENTERPRISE

Develop on a powerful set of platforms designed to help you build and grow your business. Use Microsoft Dynamics to deliver to customers, partners, and Independent Software Vendors (ISVs) customized solutions without having to custom build the foundation; use Power BI to bring visual insights to life with high impact, real-time reporting; call a single endpoint to integrate data from Microsoft’s cloud service into your app; and much more.

Power BI

Microsoft Dynamics GP

Microsoft Graph

Enterprise Cloud Alliance

Microsoft Dynamics GP

Microsoft Dynamics AX

Microsoft Dynamics NAV

Microsoft Dynamics CRM

SERVICES AND RESOURCES

Use the OneDrive API to build an integration that allows your users easy access to OneDrive files from within your app; drive your business forward with Bing ads; and ensure your apps are world-ready, globally and accessibility compliant, and logo-certified.

Security

Translation Wiki

Accessibility Developer Hub

Logo Certification

GoGlobal

SERVERS AND WEB

Use Internet Information Services (IIS) for Windows Server for a flexible, secure, and manageable Web server to enable you to host anything on the web. Get ASP.net, the free web framework for building websites and web applications using HTML, CSS, and JavaScript to create web APIs, mobile sites, and use real-time technologies. Or use BizTalk Server to create effective business processes that unite separate systems into a coherent whole.

Biztalk Server

Windows Server

SQL Server

IIS.Net

Data

Microsoft Edge

ASP.NET

 

Continue reading

Posted in Computers | Leave a comment

CodePlex – Open Source Project Hosting

via CodePlex – Open Source Project Hosting

code talks

let your voice be heard

Create Project
start a project

CodePlex is Microsoft’s free open source project hosting site. You can create projects to share with the world, collaborate with others on their projects, and download open source software.

 

Continue reading

Posted in Computers | Leave a comment

Func(T1, T2, T3, T4, T5, TResult) Delegate (System)

via Func(T1, T2, T3, T4, T5, TResult) Delegate (System)

Glenn TBCL(314.77)

Posted in Computers | Leave a comment

RSS feeds for recently published KB articles – Microsoft

via RSS feeds for recently published KB articles

Glenn – DTYTC(314.79)

 

Posted in Computers | Leave a comment