Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

New To Java Environment

Posted on 1998-06-24
4
179 Views
Last Modified: 2013-11-23
I am new to Java.  My company is looking to purchase an expense package. One happens to be coded entirely in "Sun Native Java" as the verdor says.  All of our client machines are either Windows95 or Windows NT 4.0.  I need clarification of the following:
 
Also, from a development point of view, is there a difference (classes, methods, packages, etc...) between Microsoft's Visual J++ and Sun's JDK?

I would like an definition of the Java Virtual Machine.  I don't understand how an applet or application can run on any machine.  What does the client machine need to have installed on it for Java to be interpreted?  Is it built into Windows95 or WIndowsNT??

I am sorry for the lame questions, but this site usually explains the basics very well.

Thanks
0
Comment
Question by:mtgcpc
  • 3
4 Comments
 
LVL 16

Accepted Solution

by:
imladris earned 70 total points
ID: 1223627
Microsofts JDK is a superset of Suns.

The Java Virtual Machine is the magical bit. It is the interpreter (if you remember your basic). Java is compiled into bytecodes, which is an intermediate encoding; a kind of high level "machine" code. Except that the machine it is designed for is not a hardware machine. It is an imaginary "virtual" machine. This machine is "implemented" in the JVM. It interprets the stream of bytecodes. It has a stack and it knows what to do with the instructions, so when it, for instance, encounters a load byte code, it knows it must get the value from the stack, and store causes a value to be stored in a variable etc.

So for a Java program to run on a client machine, that is precisely what needs to be installed: the JVM.

It is distributed with Win95 and NT, but is constituted in a separate program. jview.exe is the top level piece (the one you would type on the command line to activate it).

Feel free to ask for further clarification on any of the points.

0
 
LVL 16

Expert Comment

by:imladris
ID: 1223628
P.S. so how does an applet or application run on any machine? It actually doesn't quite. To be more specific: it runs on any machine for which there is an implementation of the JVM (which is really a large program which interprets the bytecodes of the program you want to run).

0
 
LVL 5

Expert Comment

by:fontaine
ID: 1223629
Visual J++ and SUN's JDK

SUN's JDK is the reference for Java developers. It is the development kit of the creators
of the language. Contrary to VJ++, it is not an IDE: you only have a Java byte code compiler,
a virtual machine and the classes to allow you develop programs and applets. If you want
to develop a program, you have to write the code in a text editor and then compile by issuing the adequate command lines in a shell. All IDE have to be compliant with the API (classes
and their methods) as defined by SUN in the JDK. This guarantees that you can run the
programs/applets in all virtual machine that follow the standard. The "old" API was defined
by JDK 1.0.2 and the "new one" by JDK 1.1. Programs written with JDK 1.1 and that use
classes or methods defined since JDK 1.1 (i.e. that were not part of JDK 1.0.2) will not
run on a JDK 1.0.2 compliant VM. However, programs written with a JDK 1.0.2 compliant
environment will still continue to run on a JDK 1.1 VM (JDK 1.1 is a superset of JDK 1.0.2).
So, what is important with an IDE is to know what version of the JDK it supports. This should be indicated in the manual of your version of VJ++. You should be warned about the fact that
Microsoft has been condamned because it introduces classes and methods that were not
part of the Java specification. It will have to remove the Java logo from its products.
Bill Gates does not like the multi-platform nature of Java because its platform is dominating
the market.

What's a VM?

Instead of generating code that is specific to a machine architecture and OS, the Java
compiler creates what is called a "byte code". It is like assembling but for a machine that
does not exist. The aim of the VM is to translate the byte code into code that is understood
by the machine that runs it. That's no more than a kind interpreter.

Why does a Java app./applet run on any platform?

Because a lot of constructors have agreed to port the Java VM for their specific machine, so
that the byte code can be understood by it.

What you need to install.

For an application, the user needs a Java VM. SUN is providing one for Win 95/NT and
Solaris. All the big companies such as HP, DEC, etc. are providing a version as well, for
their specific machine. More and more, the VM is integrated into the OS. In this case, you
have nothing to install. I think that NT has a built in VM. However, I personally prefer to
use the reference: the free VM of JavaSoft, the Java division of SUN (http://www.javasoft.com).
For the applets, the browsers use a VM that is integrated in their system.
0
 
LVL 16

Expert Comment

by:imladris
ID: 1223630
P.P.S. as you may anticipate from the above description, it is also not quite true that any Java applet or application will run on any JVM. There is, of course, just as with browsers, the potential for version problems. Specifically, a Java program written based on a particular JDK (we currently have 1.0.2 and 1.1. Version 1.2 is in beta), will run on any JVM of that version or higher. Just like web pages can be plain vanilla (that any browser will interpret) or use the latest DHTML or CCS or Java applets (which you can only view with a sufficiently recent browser), a Java application or applet needs a JVM of the right version or "better".

There is also the matter of JDK. If you use "100% pure Java", it will run on any JVM (of the right version or better), but if you use any of the extensions (the Microsoft extensions I mentioned at the beginning for example), it will only run on JVM's that implement those extensions. (This is the issue of the war between Sun and Microsoft).

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
custom annotations 9 42
Java: The Public Class Main 4 32
Is Applet the way to go for my drag and drop system? 8 25
Java basic valueOf question 1 29
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question