Which compiler is best,Borland JBuilder7 or Microsoft Visual J++?Unless their is a free one.
The JDK is free itself if you want to use commandline.
Otherwise I rather like Eclipse more than Borland, but it’s down to personal preference. Don’t touch Microsoft’s stuff as it doesn’t generally produce valid Java bytecode, judging from the number of “Invalid Bytecode” applets I find on the web these days.
Cas
: This is pretty much off topic for this forum, being more of a question for the Newbie forum a little further down.
You are getting a little confused here by the distinction between an IDE, which is a program that helps you type code and offers you tools for formatting, maintainance, visual design and so on, and a compiler, which takes your code files and makes them into the applications your system can run.
There are various compilers around, the reference implementation is the one from Sun which you can download here but there are others from IBM and elsewhere.
In pretty much any language you can write your code in a simple text editor like notepad, save it with the right filename and then compile it directly with a compiler. You don’t need JBuilder, Visual J++ or whatever. If you want a more full featured text editor there are a whole lot around, many of them offering some degree of integration with your compiler as well. My personal favourite is jext but different people use different ones. I find this useful for editing all the accompanying files you will start using as you get further on. There comes a point where a text editor becomes an IDE- I would say something close to Jcreator lite and beyond that you get into the really big compilers like Forte and eclipse. All the products I have mentioned can be downloaded for free.
To start with, do some downloading, try stuff out and see how it suits you. You don’t need to spend any money to start with, and you may not need to spend much later on. There are many disputes about what is the best IDE but it comes down to what you like using in the end. Get started, give it a try and decide for yourself.
Good luck with it.
So just one mroe explaiantory newbie note.
Java is very different in this regard from C++ or C. In C or C++ the compiler converts your program to machine code that excutes on the computer’s processor.
All the Java compilers mentioned compile Java down to Java Byte code. This is a machien code for an imaginary piece of hardware called the Java Virtual machine. This is stored in the .class file.
Most modern Java VMs will, at execution time, then compile down the important code from Java Byte Code to the local processor’s machine code.
Choice of a compiler in the C/C++ days made a fair bit of difference because it was the alst step in the process. Dependign on how well the compiler optimized the code you might get better or worse performance.
With Java however, the Java compiler typically does little to no optimization. Such premature optimization gets in the way of the run time compiler optimizing when it converts the byet code to machine code, which is where you really want all the optimizations.
Now there ARE a few Java “pre-compilers” or “ahead of time compilers” that will act like C or C++ compilers. In doing so however you lose all portability for your compield code, and the advantages if any seem small and highly debatable. But YMMV.
[quote]Most modern Java VMs will, at execution time, then compile down the important code from Java Byte Code to the local processor’s machine code.
[/quote]
The JVM does not Compile it. It iterpretes. To find out more about the JVM check out
http://java.sun.com/docs/books/vmspec/2nd-edition/html/VMSpecTOC.doc.html
The JVM does not Compile it. It iterpretes. To find out more about the JVM check out
http://java.sun.com/docs/books/vmspec/2nd-edition/html/VMSpecTOC.doc.html
To be pedantic, many different JVMs do many different things depending upon their target execution environment. For example, JVMs that run on personal devices (i.e. cell phones) typically interpret all of the time. Sun’s client Hotspot VM spends a decent amount of time interpreting for quick startup speeds. Sun’s server Hotspot VM spends very little time interpreting bytecode.
You might read the same document to which you linked:
The first prototype implementation of the Java virtual machine, done at Sun Microsystems, Inc., emulated the Java virtual machine instruction set in software hosted by a handheld device that resembled a contemporary Personal Digital Assistant (PDA). Sun’s current Java virtual machine implementations, components of its JavaTM 2 SDK and JavaTM 2 Runtime Environment products, emulate the Java virtual machine on Win32 and Solaris hosts in much more sophisticated ways. However, the Java virtual machine does not assume any particular implementation technology, host hardware, or host operating system. It is not inherently interpreted, but can just as well be implemented by compiling its instruction set to that of a silicon CPU. It may also be implemented in microcode or directly in silicon.
God bless,
-Toby Reyelts