Link to home
Start Free TrialLog in
Avatar of mtgcpc
mtgcpc

asked on

New To Java Environment

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
ASKER CERTIFIED SOLUTION
Avatar of imladris
imladris
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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).

Avatar of fontaine
fontaine

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.
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).