The best course would be to get a consistent set of header files and the libraries that go with them. If you are an internal Sun user the header files and libraries are availble as an installable package in
/net/cde-rental/motif/BUILD_SPARC_CDE1.0/cdesrc/packages.fcs-b/SUNWmfrun
You need to get this package installed on the machine where you will be doing builds.
A bit of history. Java began life as part of a larger project to develop advanced software for consumer electronics. When we started the project, we intended to use C++, but we encountered a number of problems. Initially these were just compiler technology problems, but as time passed we encountered a set of problems that were best solved by changing the language.
A quick summary is that Java is a simple, object oriented, distributed, interpreted, robust, secure, architecture neutral, portable, high performance, multithreaded, dynamic language.
The Java compiler generates an architecture-neutral object file format to enable it to run applications on a variety of CPUs and operating systems. Applications compiled into Java bytecodes can run on any system that has the Java runtime. The runtime interprets the bytecodes.
A future release of Java is likely to include a bytecode compiler which compiles bytecodes into machine code.
import HotJava.Applet; import awt.Graphics; class HelloWorld extends Applet { public void init() { resize(150, 25); } public void paint(Graphics g) { g.drawString("Hello world!", 50, 25); } }
class test { short handicap() { short hcp = (short) (0.9 * (200.0 - average())); return (hcp > 0) ? hcp : 0; } }Casting zero to be a short in the return statement stops the warning.
The error in example above occurs because the type of the ?: expression works out to be an integer, which is wrong in this case.
Here's an example. If you have your own package hierarchy: package foo.bar, and a class called MyClass, and that class is loaded across the network into a runtime that has never heard of foo.bar, your class will successfully be loaded into the foo.bar package by creating packages foo and foo.bar first.
Normally, compiled classes are shipped across the network from other machines. When those shipped classes are pulled across the network, they can be (and often are) pulled into the running system, without any need to "restart" the system. Classes are just loaded as they are needed, whether it be from the local file system or from an ftp or http connection.
It might be that your heap has gradually filled up with stuff that garbage collection isn't able to reclaim. Or, you might be trying to load a huge HTML page or image, and despite there being free memory for normal use you can't do this one thing.
In the first case you might continue but probably won't get far. In the second you might not be able to do this one thing, but smaller tasks will work just fine. It may be that the thing you are trying to do takes so much memory that it won't complete even on a fresh system. In that case you would need to restart HotJava with a bigger heap to do the operation. That is not supported in the alpha release.
Restarting HotJava is a safe fallback.If you still can't do the operation then you could assume you are trying to allocate something huge.
Send your comments or questions to the appropriate mailing list. If you need to communicate directly and privately with the java development team, send mail to java@java.sun.com.