Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Sun Lowers Barriers to Open-Source Java

Zonk posted about 7 years ago | from the coffee-making-made-easy dept.

Programming 144

Shyane writes "Sun Microsystems is making it easier for open-source programmers to ensure their Java versions meet the company's compatibility requirements, but the deal extends only to those involved in Sun's own open-source Java project. The program grants access to its Java Technology Compatibility Kit to anyone with an open-source Java project that is based substantially on Sun's open-source Java software and governed by the GPL. Programmers need access to the test kit to prove that a project is in compliance with the Java specification. Projects that pass Sun's compatibility kit tests also can use the official Java logos for free."

cancel ×

144 comments

Sorry! There are no comments related to the filter you selected.

Riots break out across the world... (4, Funny)

vigmeister (1112659) | about 7 years ago | (#20183247)

as programmers discover that the test suite only runs on Windows.

Cheers!

Re:Riots break out across the world... (4, Funny)

somersault (912633) | about 7 years ago | (#20183453)

Riot police realise that they don't actually need to do anything when all the geeks have an allergic reaction to the sunlight, and have to rush home for more pizza and caffeine to recover

Openness! (3, Informative)

kevmatic (1133523) | about 7 years ago | (#20183375)

Finally, "open, cross-platform" Java is beginning to become open. Now I just hope it becomes more cross platform, rather than "Windows, Mac, x86 Linux and whatever-you-spend-a-million-hours-developing-an-i mplementation-for."

Seriously, I was pissed when I found out just how bad Java support is for Linux PPC. I couldn't get an iMac to go to Yahoo! games for my grandma. :(

Now all we need is cross-platform Flash.

Re:Openness! (1)

somersault (912633) | about 7 years ago | (#20183507)

If it's on more than one platform, it's cross-platform. That doesn't mean that it will automatically support every processor/OS combo ever made.. do you mean now all the Linux PPC users is Linux PPC flash? Not trying to troll, just pointing out that if you want stuff available on your own platform, sometimes you're going to have to do it yourself - can't just rely on everyone else to do stuff for you. I don't know if that's possible in this case, but if it really is "open" then it should be.

Re:Openness! (1)

eln (21727) | about 7 years ago | (#20183595)

To be fair, Java was (at least initially) heavily marketed as "write once, run anywhere". It's pretty obvious that the language doesn't come anywhere near the hype in that regard.

Re:Openness! (3, Insightful)

LWATCDR (28044) | about 7 years ago | (#20183809)

Yes it really has. I have run the same Java application on Windows, Linux, and Mac OS/X. If there is a good JVM you have a very good shot at your java application working.
Yes you have to have a JVM but that is sort of a given.

It's only a dangerous language!!! (0)

Anonymous Coward | about 7 years ago | (#20186249)

It's only a language!!!

But there is a difference:
1) Java is VERY DANGEROUS!!! Sun can charge you!!!
2) C++ is not dangerous!!!

You know ANSI C, ISO C, ISO C++, ... but

and ISO Java? Such thing doesn't exist!!!

To invent ISO Caffeine? ISO Heroine? ISO Cocaine?

Re:It's only a dangerous language!!! (1)

LWATCDR (28044) | about 7 years ago | (#20187391)

JAVA IS GPL now.
Tell you what write me an IDE suing ANSI C or ISO C++ that is portable. Do it without using any libraries that are not part of the standard... Then you can get back to me.

Re:Openness! (1)

somersault (912633) | about 7 years ago | (#20183819)

Yep, that's never going to be possible without the appropriate VM/emulator/decoder for every system, whether in hardware or software. Java was a cool idea, but I've never liked it in practice.

Re:Openness! (1)

mhall119 (1035984) | about 7 years ago | (#20184589)

Yes, and Java can run anywhere you have a JVM. "write once, run anywhere" was a marketing phrase, certainly nobody believed it would run on any system anywhere without a VM. You can implement the JVM on virtually any hardware and any OS, just because a platform doesn't have a JVM for it yet doesn't mean a Java application you "write once" won't run there once they do have a JVM.

Re:Openness! (1)

rbanffy (584143) | about 7 years ago | (#20186237)

I suppose there will be './configure && make && make install' versions of both the JDK and the JRE.

Eventually.

Re:Openness! (1, Interesting)

Anonymous Coward | about 7 years ago | (#20183749)

IBM does a decent java implementation for PowerPC Linux. I didn't think it was too bad when I last tried it on an imac that i'd upgraded to Linux. I seem to remember that the package had a terribly obscure name and took some painful searching of IBM's web site to actually get the thing. Sadly all three of my imacs have hardware failures, and I can't remember what it was called.
I hope that this may help you.

Re:Openness! (1)

jrumney (197329) | about 7 years ago | (#20183785)

IBM made most of their JVMs much harder to find, or even pulled them completely about a year ago. Now I think you can only get the AIX and OS/390 versions separately, for everything else you have to get WebSphere or something else with it bundled for that platform.

Re:Openness! (1)

cerelib (903469) | about 7 years ago | (#20183895)

See my reply to the OP for a link. You can still get IBM Java versions for Linux x86 and PPC.

Re:Openness! (2, Interesting)

Rexdude (747457) | about 7 years ago | (#20186609)

I'm part of the Java6 dev team..in addition to linux, IBM Java is also available for the following platforms-
  • Windows (IA32 and AMD64)
  • Linux(IA32,AMD64,PowerPC 32/64)
  • z/OS(31 and 64 bit-yup,not a typo, z/OS uses a 31 bit addressing scheme)
  • AIX (PowerPC 32/64)
  • z/Linux 31 and 64 (Linux on system z)
  • See here [ibm.com] for the early release program.

Re:Openness! (5, Funny)

Just Some Guy (3352) | about 7 years ago | (#20183833)

Seriously, I was pissed when I found out just how bad Java support is for Linux PPC. I couldn't get an iMac to go to Yahoo! games for my grandma. :(

You gave your own grandma an iMac and then put Linux on it?

Why do you hate your grandma?

Re:Openness! (1)

Anonymous Monkey (795756) | about 7 years ago | (#20183961)

I know, if Grandma wanted Linux you should have bought her a all in one box from PCclub and with the money you saved bought her flowers every week for two months.

Re:Openness! (1)

TheRaven64 (641858) | about 7 years ago | (#20184545)

It could have been one of the old G3 (CRT) iMacs. These ran MacOS 9 well, but struggle with OS X. Putting a lightweight *NIX on them might be a good option.

Re:Openness! (1)

Just Some Guy (3352) | about 7 years ago | (#20184627)

Actually, I bought an old G3 for the kids and through 10.4 and an extra 512MB of memory on it. It runs like a champ. If Grandma wants to run Doom 3, maybe not so much, but web and email and everything else she'd be likely to do with Linux on the same hardware should be fine.

Re:Openness! (1)

empaler (130732) | about 7 years ago | (#20185703)

G3s... weren't those the "original" iMacs? If 10.4 works on those, I think I need to raid my mother's basement... :-p

(btw, you probably meant threw [m-w.com] (past tense of throw), not through [m-w.com] )

Re:Openness! (1)

Just Some Guy (3352) | about 7 years ago | (#20186515)

Yes, it runs on a G3.

And yes, I saw that the second I clicked "submit".

Re:Openness! (3, Informative)

cerelib (903469) | about 7 years ago | (#20183859)

IBM has a free version of Java, I believe up to 5.0, for Linux on PPC. I have it running on an openSUSE PowerMac. I believe this [ibm.com] is the site to look at. They don't say PPC, but you want the pSeries version (in both 32 and 64 bit varieties).

Re:Openness! (1)

PinkFreud (51474) | about 7 years ago | (#20187331)

Last time I tried this (about a year ago), it was still rather unstable. It's also pretty much the only java environment available for LinuxPPC, too, so IBM hasn't had much of a reason to update it.

Re:Openness! (0, Troll)

fm6 (162816) | about 7 years ago | (#20183901)

Give us a break. So nobody's bothered to implement a proper Java for a third-place OS running on an obsolete hardware platform. Next you'll be complaining that Java isn't available for your C64!

People seem to think it's some kind of evil plot when a software vendor doesn't support their favorite platform. The fact is, every platform you support adds a lot to your development and QA costs. If there's no business case (and there certainly isn't for any PPC platform), why should they spend the money.

And don't hold your breath waiting for some OSS folks to port Java to PPC/Linux. Even OSS people have to eat.

Re:Openness! (1)

Bill_the_Engineer (772575) | about 7 years ago | (#20184467)

Why the vile comment? It makes you look like an idiot, especially when you're obviously wrong. Let me list the ways:

1. While PPC may be in your opinion obsolete on the desktop, it is still one of the platforms of choice for embedded applications. BTW, plenty of business cases for PPC too. I personally like the ppc405gpr for low power applications, and look forward to the ppc405ez when it becomes available. Tivo likes the PPC too, but I know Tivo is not exactly popular with the GPL guys.

2. We don't have to hold our breath, just download the JVM from IBM.

3. Linux being third-place is not necessarily a bad thing, considering the number of operating systems available out there...

Anyway it's Friday, so relax this weekend. You obviously need the rest.

Re:Openness! (1)

fm6 (162816) | about 7 years ago | (#20184937)

My argument is "vile"? You're the one that's making personal comments.

Re:Openness! (1)

Bill_the_Engineer (772575) | about 7 years ago | (#20185041)

LOL

Maybe abrasive is a more appropriate term...

Re:Openness! (1)

fm6 (162816) | about 7 years ago | (#20185819)

I'll buy "abrasive". That's a pretty good description of my personality. But my personality traits have nothing to do with the validity of my arguments. Nor do they justify your using the word "idiot".

As long as we're discussion personalities, go look up the word "patronizing".

Anyway, now that we've thoroughly abused each other, let's look at your arguments:

1. While PPC may be in your opinion obsolete on the desktop, it is still one of the platforms of choice for embedded applications.
Fine, I should have qualified my statement: "obsolete on desktop systems". Though that's just a little pedantic.

When I started using microcomputers in the late 70s, the leading desktop CPU was the Zilog Z80. That processor is still widely used in embedded applications (many of the credit card swipers use it) but nobody wants a desktop system with an 8-bit processor any more. Also "obsolete", at least for our purposes. We're talking about personal computers (in the broad sense); what's going on in the embedded world is a whole different thing. People don't play Java games on their TiVo.

We don't have to hold our breath, just download the JVM from IBM.
The IBM JVM supports POWER. Which of course IBM has to support, since they sell a lot of POWER-based systems. But POWER and POWER-PC are different chips, even though one is derived from the other. I'm guessing that it's wouldn't be terribly hard to make POWER software run on the POWER PC. But the fact is, nobody's taken the time to do it. Which was exactly my point: there isn't a lot of incentive to support PPC.

Also, I notice that the IBM JVM only support Java 5. Java 6 went GA almost a year ago, and was available in Beta long before that. So even a company with IBM's resources can't provide a JVM that runs the latest Java software. How can some OSS volunteer group hope to do so?

Linux being third-place is not necessarily a bad thing, considering the number of operating systems available out there...
It's a bad thing in terms of getting software vendors to pay attention to you. Which is why Sun resisted porting Java to Linux for such a long time. They do now (probably because they finally got serious about supporting Linux on their servers), but only for x86. It would take more than a few disgruntled Mac/Linux users for there to be a PPC port.

Basically, you didn't rebut any of my arguments, you just picked nits with they way I expressed them. Really, that makes you look like... No, let's not go there again.

Re:Openness! (1)

kevmatic (1133523) | about 7 years ago | (#20187323)

Well, you could buy a PowerPC-based Mac less than a year ago. C64-level obsolete, clearly. Not to mention that there's lots of other systems out there that still use it (Pegasus, etc.).

The IBM PPC Java implementation is actually pretty fast, but when I used it a year ago, only Konqueror and an ancient ancient version of Mozilla supported it, and many websites (like yahoo games) won't run in Konqueror, even if you change the browser ID. And its not made for it, but rather Websphere (gag) and the like. You aren't going to be browsing the net on a POWER server.

I guess I got irritated over the fact that, even though there are so many excellent computer systems out there, thanks to Java and Flash, you can only really browse the Net on 32bit Windows, Macs, Solaris, and Linux 32bit x86. The rest you have to hack your way around.

Now that I've typed that out, though, it seems its not as bad as I thought, but still, its limiting on the Linux front.

Flash is so slow, anyway, that it is more or less useless on anything slower than 1Ghz or so. And 500Mhz machines struggle to play card games written in Java...

Re:Openness! (1)

RockoTDF (1042780) | about 7 years ago | (#20185181)

IBM uses the POWER architecture (PPC's big brother) in their servers and mainframes. They aren't quite the same thing, but porting it wouldn't be super hard, and would probably be a good idea given all the embedded linux stuff that runs PPC.

Java on Solaris (1)

Frankie70 (803801) | about 7 years ago | (#20184117)

Forget Linux, Java works much better on Windows than on Solaris.
I found Java on Solaris to be rather buggy.

Re:Openness! (1)

ChristTrekker (91442) | about 7 years ago | (#20184931)

No kidding. I've been hanging on to an older version of JOnAS just because I can't find a modern Java to run the newer ones with. I'm not sure I'm thrilled with some of the additions in Java 5, but the JVM continues to be refined and optimized, regardless of the language evolution.

Re:Openness! (1)

dubbreak (623656) | about 7 years ago | (#20185029)

In my experience the Yahoo! games don't run properly with the Sun JVM on windows. They do seem to run well on windows using the MS JVM.

I've tried to play some of those games against her using my linux laptop and it was hopeless. Instead we play Tetris attack using a snes over the network.

Re:Openness! (1)

moosesocks (264553) | about 7 years ago | (#20186617)

I've been using UbuntuPPC for the past few months.

It's excellent, and honestly doesn't feel any different than the X86 version apart from the profound absence of binary-only software such as Flash, Google Earth, and even a barely usable JVM.

It's delightfully ironic that the rest of the operating system (written in languages like C and C++) works perfectly fine, whereas Java is completely non-functional.

Can we please stop treating Java as if it's a serious language? It's a complete and total failure on so many levels. Writing an application in C, and using a cross-platform toolkit such as GTK+ could easily avoid many of the headaches of Java, whilst offering vastly improved performance and usability.

Re:Openness! (1)

also-rr (980579) | about 7 years ago | (#20187249)

You can run Yahoo Java games on Linux PPC using the IBM JRE. I wrote a set of installation instructions [revis.co.uk] for it that cover installation and setting up the Firefox plugin.

The installation isn't Grandma level, but once it is up and running it is no different to Yahoo games on Windows.

don't need this (0)

rubycodez (864176) | about 7 years ago | (#20183383)

software only needs to have its own built in unit tests to verify that it works, Sun can butt out.

Re:don't need this (2, Interesting)

eln (21727) | about 7 years ago | (#20183533)

Sun's test suite isn't just to verify your code works, it's to verify your implementation of Java complies with the standards before they allow you to slap the Java logo on it. It's a good way to keep things open while still maintaining control over the Java standard, and preventing fragmentation of the language.

Re:don't need this (3, Informative)

Anonymous Coward | about 7 years ago | (#20183863)

Translation: No Microsoft MSJava++ with Sun's Java logo on it.

Re:don't need this (2, Insightful)

Anonymous Coward | about 7 years ago | (#20184007)

Bullshit. Unit tests can at most prove that a single piece of software "works" in an internally consistent fashion. They might be marginally sufficient when you're building a single-platform doghouse-sized app. They're a very small part and hardly sufficient part of the process of building a skyscraper, though, and can't verify that an app will work in any specified environment.

This Sun tool seems to validate your implementation against some standard.

By validating your code against some reference standard where that standard is defined as meaning cross-platform safe, your code is cross-platform safe.

That's a huge part of "write once, run anywhere". Denigrating that validation with some pap about small unit tests is asinine.

Re:don't need this (1)

Bill_the_Engineer (772575) | about 7 years ago | (#20184509)

Wish I could mod the parent post up...

Re:don't need this (1)

rubycodez (864176) | about 7 years ago | (#20186129)

the issue is of letting Sun decide what is compatible or not. Let an outside body working from the published standards do that. And this Sun package is a set of unit tests. And as for cross-platform, of course well designed unit tests can check that.

Java == Nice Toy (-1, Troll)

Anonymous Coward | about 7 years ago | (#20183443)

I've said it once, I'll say it again. Java is a nice toy programming language, for those people who can't afford a 'real' compiler, Like Borland, or Even Microsoft. Hell, even GCC does a better job than most java interpreters.

It's a nice learning language, shielding the user from most of the complexity of a real programming language, and that's exactly what makes it so dangerous and stupid.

This only serves to prove the theory. Only useful in bullshit GPL licensed projects. Let me know when the dream of 'write once run anywhere actually happens.

Re:Java == Nice Toy (0)

Anonymous Coward | about 7 years ago | (#20183563)

+5 Unintentionally Funny for displaying amazing amounts of stupidity. I'll bet he's glad he posted that anonymously...

Re:Java == Nice Toy (2, Insightful)

Marcus Green (34723) | about 7 years ago | (#20183573)

Go to your job web site of choice and key in the names of your favorite programming language. Notice that there are a huge number of jobs for Java skills (usually more than any other language but always a very close run match). Then ask yourself, if it is such a toy why are so many people prepared to pay good money to advertise for these skills?

Re:Java == Nice Toy (-1, Troll)

Anonymous Coward | about 7 years ago | (#20183815)

Ever see how many VB jobs there used to be. Or "AJAX" "Web 2.0" now. Java is a fad language, little understood by managers who want the new best thing. Then of course they need all new hardware because performance sucks so much. It had really good potential to be a cross platform system but little by little the incompatibilities cropped up.

Re:Java == Nice Toy (0)

Anonymous Coward | about 7 years ago | (#20184907)

A bit of a long-running fad, y'think? I suppose you think those "horseless carriages" are also just a fad.

Re:Java == Nice Toy (0)

Anonymous Coward | about 7 years ago | (#20187329)

A Java horseless carriage might run on all roads, with all fuels.

Bad example!

Re:Java == Nice Toy (1)

kv9 (697238) | about 7 years ago | (#20185509)

Then ask yourself, if it is such a toy why are so many people prepared to pay good money to advertise for these skills?
because they don't know any better? quality vs quantity? (see: Windows) I don't know. I'm just saying.

Re:Java == Nice Toy (0)

Anonymous Coward | about 7 years ago | (#20185607)

well, because most people are idiots..... i went from perl to c++, and then to C. you should read up a little more before you take so much time in learning a new discipline. Sun wont even let Java into its corporate infrastructure, they say it is to immature so "use c".... -- this came from one of their internal memos.

Java Programmers == Typists (0, Insightful)

Anonymous Coward | about 7 years ago | (#20183873)

Java programms are nothing more than typists who can understand how to string together bits of code from the latest
'Type and Learn' Java Book.

To Me, a Programming Language is 'Real' When it can fully bootstrap itself. That is, Compile it's own Compiler. Java of Course, being an interpreted language, fails that test miserably. I've once seen a student project, a java interpreter, written in Java. I've seen frozen molasses move at a faster pace.

Java is nice if you don't want to worry about complexity, or managing algorithms, etc. I think of it like VB, nice for building proof of concepts, fast 'throw-away' prototypes.

Re:Java Programmers == Typists (4, Insightful)

AKAImBatman (238306) | about 7 years ago | (#20184111)

You fail it.

That is, Compile it's own Compiler.

Failure #1: Java's compiler is written in Java. The first use of the early Oak/Java VM was to get the compiler self-compiling.

To Me, a Programming Language is 'Real' When it can fully bootstrap itself.

Failure #2: Java *can* bootstrap itself just fine, thank you very much.

http://www.jnode.org/ [jnode.org]
http://jikesrvm.org/ [jikesrvm.org]

"A distinguishing characteristic of Jikes RVM is that it is implemented in the Java(TM) programming language and is self-hosted i.e., its Java code runs on itself without requiring a second virtual machine."

being an interpreted language, fails that test miserably.

Failure #3: You called Java an interpreted language. Java is a compiled language that runs on a virtual machine. Like most VM-based platforms, that provides two options. The first is to interpret the bytecodes directly. The second is to compile the bytecodes into native code at runtime using a Just In Time Compiler. The most common JIT compiler for Java is the HotSpot VM [wikipedia.org] . HotSpot is quite capable of keeping pace with and even exceeding the performance of native code.

http://www.idiom.com/~zilla/Computer/javaCbenchmar k.html [idiom.com]

I've once seen a student project, a java interpreter, written in Java.

Failure #4: You see these things, yet you fail to take the time to understand them. You have failed as a geek. Turn in your member card immediately and leave in shame.

Re:Java Programmers == Typists (0)

Anonymous Coward | about 7 years ago | (#20184239)

Failure #3: You called Java an interpreted language. Java is a compiled language that runs on a virtual machine. Like most VM-based platforms, that provides two options. The first is to interpret the bytecodes directly. The second is to compile the bytecodes into native code at runtime using a Just In Time Compiler. The most common JIT compiler for Java is the HotSpot VM. HotSpot is quite capable of keeping pace with and even exceeding the performance of native code.

Even worse, there are static, "ahead-of-time" compilers for Java, most notably GCJ, for those that really want it.

Re:Java Programmers == Typists (1)

teknopurge (199509) | about 7 years ago | (#20184741)

How dare you present a link that makes the OP look like a tool!

Re:Java Programmers == Typists (0, Troll)

Anonymous Coward | about 7 years ago | (#20185089)

Failure #1: Java's compiler is written in Java. The first use of the early Oak/Java VM was to get the compiler self-compiling.
Then explain why there's a "javac.exe" under Windows and:

$ file -L `which javac`
/usr/bin/javac: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped
$ javac -version
javac 1.6.0

Failure #2: Java *can* bootstrap itself just fine, thank you very much.
No, it can't. By definition you have to start with a JVM written in something that isn't Java. Otherwise your JVM is written in bytecode that nothing can run, since it isn't compiled to native code until runtime.

Failure #3: You called Java an interpreted language. Java is a compiled language that runs on a virtual machine.
By that definition, Python, Perl, and JavaScript are all compiled languages. All the current implementations of those languages compile the language into bytecodes which are then interpreted directly. Java and Python have the option of saving those bytecodes to a file and then skipping the parse step.

But I already know you're a Java fanboi, which is rather pathetic.

Re:Java Programmers == Typists (0)

Anonymous Coward | about 7 years ago | (#20185263)

Wow. It's been a while since I've seen a post of such breathtaking stupidity on /. and nowadays that's saying a lot. My hat is off to you sir!

Re:Java Programmers == Typists (3, Informative)

AKAImBatman (238306) | about 7 years ago | (#20185299)

You continue to fail it. Amazing.

Then explain why there's a "javac.exe" under Windows and [Linux]

Simple. It's a stub. Typing "java -cp tools.jar com.sun.tools.javac.Main" all the time isn't very convenient, so Sun provides executables that load the JVM and execute the compiler. If you look in your JDK installation directory, you can find the tools.jar file in the "lib" subdirectory. You can try running it from that directory as above, or look inside the zip file for the mindblowing (eye roll) Java class files for the compiler.

No, it can't. By definition you have to start with a JVM written in something that isn't Java. Otherwise your JVM is written in bytecode that nothing can run, since it isn't compiled to native code until runtime.

Perfect example of someone who didn't read or take the time to understand. The Jalapeno VM and JNode OS are both written in pure Java. They used their own JIT compiler to compile themselves into native code. That native code is a Java program that runs on the native platform.

By that definition, Python, Perl, and JavaScript are all compiled languages.

Python is not compiled. Perl is not compiled. Javascript is not compiled. These languages are read in, line by line, and executed. You fail it.

This is CS101 stuff we're talking about here. How badly can you fail it?

Re:Java Programmers == Typists (0)

Anonymous Coward | about 7 years ago | (#20185433)

The Jalapeno VM and JNode OS are both written in pure Java. They used their own JIT compiler to compile themselves into native code.
And how do you propose to run them and their JIT compiler without another VM? You need a VM written in some other language to actually use them. That's not bootstrapping.

Python is not compiled. Perl is not compiled. Javascript is not compiled. These languages are read in, line by line, and executed. You fail it.
Yes, they are. Modern interpreters compile the language and then run the bytecode. Early interpreters work the way you describe because memory was at a premium. With modern amounts of memory, there's no need to recompile the code every time its executed. Instead they compile them into bytecode and run that bytecode: exactly like Java.

See Parrot [parrotcode.org] , the VM for Perl, and Tamarin [mozilla.org] , Mozilla's JavaScript VM.

Re:Java Programmers == Typists (2, Insightful)

AKAImBatman (238306) | about 7 years ago | (#20185855)

And how do you propose to run them and their JIT compiler without another VM?

How you think Linus wrote the first version Linux? By flipping switches on the front of his Honeywell? Of course not, fool! He used Minix as a host platform to compile the first versions. You always need a host platform to bootstrap the first copy before it can become self-hosting.

Modern interpreters compile the language and then run the bytecode. Early interpreters work the way you describe because memory was at a premium.

These words come out of your mouth, but you obviously don't understand what they mean. Early interpreters started the concept of "compiling down" interpreted code because memory was at a premium. It's not a Virtual Machine, it's a symbolic language that makes it easier to execute the code.

Hell, I have a Commodore 64 sitting at home that keeps all its programs in a symbolic form to preserve its mere 64K of memory. I know you have no idea what a Commodore 64 is (I'm pegging you at somewhere around 12-14) but programmers often wondered why their programs were being reformatted by the machine. As it so happens, it wasn't reformatting them. It was translating the programs to symbolic codes, then translating them back when the user asked for a program listing.

See Parrot, the VM for Perl

Parrot is a VM. Period. Languages like Perl can be compiled for it if desired. Jython [jython.org] also exists to target Python execution in the JVM environment. The existence of these tools does not make the languages any less of interpreted language. It merely provides a specific implementation which is compiled. Just as many companies used to offer BASIC compilers, even though BASIC was technically an interpreted language.

Tamarin, Mozilla's JavaScript VM.

Taramin is the latest version of the Virtual Machine designed for the Flash platform. The Actionscript language was evolved toward ECMAScript compliance, thus making it an excellent platform for JITing Javascript code.

Again, you fail it. Go back to high school, graduate, work your way through a college education in CS, then come back when you know what you're talking about.

Re:Java Programmers == Typists (0)

Anonymous Coward | about 7 years ago | (#20186145)

Again, you fail it. Go back to high school, graduate, work your way through a college education in CS, then come back when you know what you're talking about.
Says the guy who can't tell the difference between a parse tree (what early interpreters use) and bytecodes (what modern interpreted languages use).

The difference between interpreted languages and compiled languages these days is largely academic. Most modern implementations use virtual machines. Hell, even Java has JSPs, which use Java like a scripting language.

Re:Java Programmers == Typists (0)

Anonymous Coward | about 7 years ago | (#20186521)

Parent(OP) AC, give up you have been utterly destroyed by this gentlemen. I wish I had mod points, he deserves the small collection of +5's. You weren't even a good troll, just someone smart enough not to post logged in. If you found one minor flaw in his wording, if he chooses not to destroy you further, consider yourself lucky and go home. Both are large ifs I imagine.

Re:Java Programmers == Typists (3, Insightful)

AKAImBatman (238306) | about 7 years ago | (#20186773)

You mean like what Perl uses [perl.org] ? :-/

Perl has always had a compiler: your source is compiled into an internal form (a parse tree) which is then optimized before being run.

From my understanding of the engine, SpiderMonkey works along similar lines, using a combination of byte codes and parser information to perform execution. This is a bit different approach from the Flash VM, which pre-compiles the source into a representation executable by its "Actions" VM.

The difference between interpreted languages and compiled languages these days is largely academic.

I will agree with this. True interpreters are a rare find these days. Interpreting bytecodes is becoming a common method, and even JITs are showing up in a lot of interpreted languages. That being said, the one distinction is that interpreted languages rarely give up their interpreters. If you give them a dynamic piece of source code, they will execute it whether it does a strict interpretation of the source or a full compile to its internal VM.

In comparison, Java is a strictly compiled language designed for the Java VM platform. Furthermore, it is JITed at runtime and is no longer interpreted as most VMs designed for "interpreted languages" do.

Hell, even Java has JSPs, which use Java like a scripting language.

Scripting is not the same thing as interpreted. JSPs are compiled before execution. The file is turned inside out by the parser (all that HTML becomes output.write("") statements) then compiled by JavaC, loaded by the ClassLoader, and finally executed by the HotSpot VM. It's an involved process, but it's much faster than the traditional interpreted approach of PHP and pre-.NET ASP.

Re:Java Programmers == Typists (0)

Anonymous Coward | about 7 years ago | (#20185801)

Python is not compiled. Perl is not compiled. Javascript is not compiled. These languages are read in, line by line, and executed.
Wrong, wrong and wrong. The other AC mentioned Parrot and Tamarin, but it's not even necessary to look that far ahead. The current canonical implementations of Perl [perl.org] , Python [python.org] and JavaScript [mozilla.org] all compile the program to bytecode before execution.

You fail it.
Right back atcha.

Re:Java Programmers == Typists (0)

Anonymous Coward | about 7 years ago | (#20185997)

He meant NATIVELY compiled, as in either AOT or JIT execution.

You're talking about bytecode interpretation, i.e. NOT COMPILED.

You lose, good day sir!

Re:Java Programmers == Typists (0)

Anonymous Coward | about 7 years ago | (#20187333)

hey look, someone who doesn't know what "compiled" means

Re:Java Programmers == Typists (1)

FireHawk77028 (770487) | about 7 years ago | (#20184263)

Java is no longer "interpretted". see Just In Time compilation (JIT). Development time is much faster than Java (and also C#) than with C++ due to the faster time to run. Have you ever built a 500,000 line C or C++ program from source? May as well go out to lunch. With java or C# that can be done in a fraction of the time. Want to talk about "Garbage collection"? It has an added benefit of defragmenting your memory which leads to fewer CPU cache misses. There is no reason that a compiler for java could not be written in Java. Did you know that your x86 "machine code" is actually interpreted? see "microcode" and "complex instruction set". Ever write assembly/c/c++ program to write compile and run its own code? see dynamic class loading

Re:Java Programmers == Typists (1)

nuzak (959558) | about 7 years ago | (#20184865)

HotSpot on the server VM is not particularly "Just In Time" -- it compiles ahead of time. What's truly annoying though is that it doesn't cache the compiled at all, which partly accounts for its glacial startup time. Java runs circles around other bytecode-interpreted languages like perl and python, but the startup time is still tied as the #1 deal-breaker alongside the larged fixed heap that makes everything in Java look like bloatware even if it isn't.

Re:Java Programmers == Typists (2, Informative)

matfud (464184) | about 7 years ago | (#20185289)

Actually hotspot compiles code after it has been interpreted for a while and it has noticed that it is a "hotspot" in the code (sort of there in the name really). The slow start up is because
a) it loads and validates a fuck load of classes at startup (although the preverified core classes can be cached)
b) it starts running in interpreted mode.

matfud

Re:Java Programmers == Typists (1)

nuzak (959558) | about 7 years ago | (#20186953)

> Actually hotspot compiles code after it has been interpreted for a while and it has noticed that it is a "hotspot" in the code

I stand corrected -- my confusion came from looking at a possible set of configuration defaults for the server VM where it can effectively compile everything ahead of time by dialing down all the profile thresholds way down. These probably aren't particularly sane defaults either. It looks like the main difference is that the server VM performs more aggressive optimizations.

Still, wouldn't it be nice if it cached? I understand That Other VM does it (and also has much nicer versioning).

Re:Java Programmers == Typists (1)

IBBoard (1128019) | about 7 years ago | (#20187239)

Java programms are nothing more than typists who can understand how to string together bits of code from the latest 'Type and Learn' Java Book.

Wow, you must have seen some low quality programmers, then.

Java is nice if you don't want to worry about complexity, or managing algorithms, etc.

No managing algorithms? Huh? In what way do you not have to manage algorithms?

I think of it like VB, nice for building proof of concepts, fast 'throw-away' prototypes.

Better not tell the MoD (Ministry of Defence, UK Government) since they have Java as one of their approved languages. Yes, C and C++ are also approved, but AFAIK C# hasn't been yet (and hopefully neither has VB!)

Yes, you can write fast prototypes in Java, but that's just one of the things made easier by Third Gen/high level languages and object orientation.

I wouldn't even want to use VB for a prototype, though. Far too ugly and Windows-based a language for that ;)

You failed programming, didn't you? (4, Insightful)

Dancindan84 (1056246) | about 7 years ago | (#20183897)

Java is a nice toy programming language, for those people who can't afford a 'real' compiler, Like Borland, or Even Microsoft. Hell, even GCC does a better job than most java interpreters.
That's just golden.

Re:You failed programming, didn't you? (0, Redundant)

AP2k (991160) | about 7 years ago | (#20183991)

When a Java program I compiled and ran on my computer doesnt work but compiles and runs on someone elses perfectly, there is something wrong.

HINT: Its not the computers.

Re:You failed programming, didn't you? (1)

cerelib (903469) | about 7 years ago | (#20184133)

Were you using the same version number on each computer? If you use a newer version to compile, say JDK 6, and then try to run it on an older version, say JRE 1.4.2, there can be incompatibilities. This happens because the JDK defaults to compiling towards the newest version (API and bytecode format), but you can configure options to compile to any old version level you want (target 1.3 which will work on 1.3, 1.4, 5.0, and 6.0 if you are going for serious compatibility). This can be a very useful feature, but can lead to frustration in mixed environments if you don't understand it. Since you said that it can compile and run on both computers, that seems to indicate that this may be the source of your problem. My point, don't be so quick to blame bad implementation.

Re:You failed programming, didn't you? (1)

mhall119 (1035984) | about 7 years ago | (#20184733)

Right, and that's true in any language, isn't it?

Hint: It's the programmer.

Re:Java == Nice Toy (1)

a1mint (1021941) | about 7 years ago | (#20187379)

Idiot remarks about Java are actually rare these days. Most understand the power of Java these days, but some like yourself stay in the dark ages for unknown reasons. Practically everything you've just barfed up is incorrect. No need for me to elaborate, you've got your @ss kicked by all the other responses already.

Too little, too late (0, Troll)

Anonymous Coward | about 7 years ago | (#20183493)

But then again, Java always was slow.

(ya ya, except when it's called an assembly language math function in its library)

So what about gcj? (1)

martin_the_geek (212681) | about 7 years ago | (#20183499)

What is happening to the FSF's java project now?

Re:So what about gcj? (5, Informative)

loubs001 (1126973) | about 7 years ago | (#20183767)

Fortunately the GNU Classpath guys are right on board with OpenJDK. One of their most prominent members Dalibor Topic (who's the lead on the Kaffe VM) is on the OpenJDK governence board and works with Sun and other representivies on managing the project. Other promiment members like Roman Kennke, David Gilbert, Mario Torre and others. are active on the OpenJDK mailing lists and submitting patches. They are all interested in becoming regular contributors to the project.

Other GNU Classpath developers working for Red Hat were very quick to produce a version of OpenJDK using pieces of Classpath to fill the wholes of "encumbered" components that havent been open sourced (like the font, graphics and sound engines that were licensed by Sun by 3rd parties). This is called IceTea. Though its more of a quick 'n dirty temporary project to have a completely GPL JDK right now until the holes can be plugged properly. For example, Sun released a more sophistated FreeType based font engine this week, and the rest of the holes will eventually be filled. But for now, IceTea is a great playground for experimentation. And as far as I can tell, Red Hat wants to contribute anything useful back in OpenJDK.

You might that the GNU Classpath guys would be dissapointed, feeling that their hard work is obsolete, but no, they're happy because they know they were a big part of the reason why OpenJDK exists, and they're looking forward to contributing.

Re:So what about gcj? (1)

petermgreen (876956) | about 7 years ago | (#20186813)

Other GNU Classpath developers working for Red Hat were very quick to produce a version of OpenJDK using pieces of Classpath to fill the wholes of "encumbered" components that havent been open sourced (like the font, graphics and sound engines that were licensed by Sun by 3rd parties). This is called IceTea.
since it took me a while to find this (it didn't help that you got the name wrong) i'll post a link here, hopefully the site can handle /.

http://article.gmane.org/gmane.comp.java.openjdk.d istro-packaging.devel/5 [gmane.org]

Re:So what about gcj? (1)

ianare (1132971) | about 7 years ago | (#20183811)

it's still being actively [gnu.org] developed. GCJ is part of GCC, so I don't think it will be abandoned anytime soon.

Re:So what about gcj? (0)

Anonymous Coward | about 7 years ago | (#20184165)

gcj is not java, btw

Re:So what about gcj? (1)

Constantine XVI (880691) | about 7 years ago | (#20184171)

If you meant Classpath, the GNU-built JavaVM, it's probably going to see a sharp rise in compatibility with Sun Java.
If you meant GCJ (GNU Compiler for Java), doesn't really mean too much. GCJ compiles Java into native code, which is entirely different from Classpath, Harmony, and SunJava

Re:So what about gcj? (1)

nuzak (959558) | about 7 years ago | (#20184799)

> If you meant Classpath, the GNU-built JavaVM, it's probably going to see a sharp rise in compatibility with Sun Java.

Classpath is not a JVM, it is an implementation of the standard JDK library.

Re:So what about gcj? (1)

petermgreen (876956) | about 7 years ago | (#20186765)

What is happening to the FSF's java project now?
My suspicion is the java clones will slowly die off as linux distros, even the license paranoid ones start shipping sun based java

but that cannot happen until sun java is completely free which it isn't yet (though someone mentioned a project to hack up a working java based on the free stuff sun has released in another reply to you).

Finaly a good native compiler. (1)

LWATCDR (28044) | about 7 years ago | (#20183841)

I so want a native Java compiler. I like Java but the loading of the runtime is a bit of a pain. The option of compiling a native version would be very nice.

Re:Finaly a good native compiler. (1)

canistel (1103079) | about 7 years ago | (#20183981)

Not sure if you're aware of this or not, but gcj (gcc for java) will compile to native code. I have used it in linux; you do have to watch out for things like swing, as only part of swing is supported using libraries like SwingWTX (swing api over swt which is a native controls library). I think you can do something similarly for windows, but IIRC, it uses a 10mb runtime library which you need to then package along with your project.

Re:Finaly a good native compiler. (1)

LWATCDR (28044) | about 7 years ago | (#20187307)

Yes I am aware of GCJ. That is why I am hopping for that native compiler. With Java being GPL now GJC should have no problem with supporting all of the class libraries like Swing. So yea GCJ is my reason for hope.

Re:Finaly a good native compiler. (1)

FireHawk77028 (770487) | about 7 years ago | (#20184035)

Java does have native compilers, not by Sun though. When you native compile you loose some of the on the fly debugging capabilities of java, sometimes even dynamic class loading.

Re:Finaly a good native compiler. (1)

loubs001 (1126973) | about 7 years ago | (#20184039)

For client Java developers like myself, the availability of the runtime is definitely the biggest challenges we face. Most computers do have a Java runtime installed, but few have the very latest, which is a shame because the last couple of releases have been MAJOR advances over 1.4 and earlier, which were admittedly pretty crappy for the client side. But Java 6 is excellent, but since it was only released in December, most people dont have it, and dont want to download even 7MB for it, and Java 7 is shaping up to be even more significant than Java 6. But I'm afraid, a native compiler wont solve the problem. You'd still need the libraries somewhere. So they'd still have to be installed previously, or include them with the application. Either way, there's downloading to be done. (though one of Java's major advantages is that once the platform IS installed, the actual applications tend to be remarkably small, because so much functionality is in the platform, and because of the amazing pack200 classfile compression). Plus, believe it or not, contrary to popular belief, an ahead-of-time native compiler would actually perform very poorly. The nature of the Java language depends on the runtime optimizations in order to achieve high performance. But that ends up being a good thing, because runtime optimzations allow it to optimize everything a C++ compiler can, and so much more. Still, Sun is well aware of the deployment problem. They have an entire team working to solve it in a future release targeted for early next year. Basically the initial download will be tiny (just a couple of MB) which contain the most common libraries, and the rest will be streamed in the background while the app is already running. Hopefully this will work out well. Early reports are promising. Deployment is a hard problem when your technology isnt bundled with the OS, but it is being worked on!

Re:Finaly a good native compiler. (1, Funny)

Anonymous Coward | about 7 years ago | (#20184151)

Deployment is a hard problem when your technology isnt bundled with the OS
Once apon a time, M$ used to include Java interpreter in there OS's, but Sun seemed to have a problem with that...

Re:Finaly a good native compiler. (3, Interesting)

loubs001 (1126973) | about 7 years ago | (#20184305)

Yeah, I had a problem with that too. Because they added proprietary extensions that breached the specification (including Windows specific features), as well as omitting required features. Code written for the Microsoft VM wouldnt run on anyone elses. An implementation must be certified as compliant in order to use the Java brand. Microsoft's wasnt, so Sun sued. They won, and rightfully so.

But I'm glad this happened. It caused Microsoft to go off and create rival platform (.NET) and a rival language (C#). Maybe not so great for Sun, but great for the developer community, because it created good solid competition and both platforms are advancing at a rapid pace because of this.

Re:Finaly a good native compiler. (1)

fm6 (162816) | about 7 years ago | (#20186203)

"Loading the runtime" basically amounts to transferring the libraries from disk to RAM. So startup time has nothing to do with the supposed efficiency gain for native code compared to byte codes. (Which is mostly not true anyway, but that's another issue.) What it does have to do with is the size of the files being loaded. Translating the libraries to native code wouldn't necessarily make them smaller. Indeed, it would probably make them bigger.

Re:Finaly a good native compiler. (1)

LWATCDR (28044) | about 7 years ago | (#20187345)

Except that that if you statically link with the libraries your application will only load the part of the library needed for the application. Of course that will mean that your code will have to be GPL but for in house programs or programs you plan on releasing as GPL from the start that isn't an issue.

JIT can't mmap binaries for shared mem (1)

mechsoph (716782) | about 7 years ago | (#20187457)

Native (.so) libraries are loaded using mmap. The means that even though every program links to libc, there's only one copy of it in memory. It also means that a new process that gets to run doesn't have to reload libc from disk.

Since java has to decompress/JIT it's libraries each time a program runs, each process will have its own copy of all the libraries. Making better use of the shared memory facilities provided by the OS is one possible benefit of compiling java to native code.

Just starting out with Java (4, Interesting)

RockHorn (896105) | about 7 years ago | (#20183989)

I am a fledgling java developer, and so far I'm loving it! Every time I hear about the advances Sun is making towards GPLing java, the more I feel justified in taking the time to learn java.

I came into this business from a bit of a back door (although I suspect it to be a common back door these days). I started with spaghetti code PHP, moved to OOP php with php4, then php5. I am now quite frustrated by the partial OOP implementation of php5, as I develop more complex applications. I become even more frustrated with PHP the more I learn about java. The type safety at compile time makes it far easier to develop bug-free code. Method overloading is problematic in php, I usually end up implementing a single function with all sorts of optional arguments, and checks to determine whether a particular parameter is an array.

Additionally, Java gives me code re-use at it's ultimate. For instance, I write a single been that updates our LDAP; I then use that bean in a JSF web application, in a batch program running on an an IBM iSeries, in a command line application on Linux, and most recently in a Swing application. Having written the bean once when developing the first application, I never had to write a single LDAP query when developing my latter applications. Any bugs I find in the bean from one of the apps means the bug gets fixed for all the other apps.

Not to mention that I do my development on my Mac, and deploy software across our organization to Windows and Linux desktops.

Write once run anywhere for sure - I'm sold!

Re:Just starting out with Java (0)

Anonymous Coward | about 7 years ago | (#20184181)

For instance, I write a single been that updates our LDAP; I then use that bean in a JSF web application, in a batch program running on an an IBM iSeries, in a command line application on Linux, and most recently in a Swing application.
Congratulations! You've just discovered code reuse.

Of course don't let the fact that you can re-use code in pretty much any programming language spoil your glow of Java-loving pride...

Re:Just starting out with Java (1)

RockHorn (896105) | about 7 years ago | (#20185265)

Of course don't let the fact that you can re-use code in pretty much any programming language spoil your glow of Java-loving pride...

Right, so I can take something written in PHP and make a gui application out of it?

You'll probably come back and say you meant a real programming language. How many web sites are made using C/C++ these days? How many gui programs are made using Perl, or Ruby? How cross-platform is all that .Net stuff?

What other languages other than Java and Python allow for code re-use in such varied environments? No sarcasm intended with this question - please, by all means, educate me!

Re:Just starting out with Java (0)

Anonymous Coward | about 7 years ago | (#20186669)

PHP gui applications are not out of the question. The tools are available. PHP-GTK is one, there are probably more.

Re:Just starting out with Java (0)

Anonymous Coward | about 7 years ago | (#20185075)

Easy on those overloaded methods now. I suggest you read this first:

http://www.artima.com/weblogs/viewpost.jsp?thread= 7852 [artima.com]

I too fled from PHP, but not to Java.

-Randall

Sun can still do better ... and easily (1)

Skapare (16644) | about 7 years ago | (#20184787)

Sun can still do better ... and easily.

"We've known that we weren't going to be able to satisfy everyone in the open-source and free software worlds. There are incompatible licenses and philosophies and approaches," Sands said. "We're trying very hard to figure out some way to bridge this, but we've not been able to do that."

[...]

The compatibility kit itself, though, is not an open-source project. "We wouldn't want people being creative about what compatibility means, because then you end up breaking compatibility," said Jean Elliott, senior director of Java software product marketing.

I'm not expecting Sun to necessarily release its own implementations in source code. However, any test kits for compatibility need to at least be made available to any and all open source developers. For Java compilers, clearly that much of it must have source code available. For run time engines, the test kit can be class files (compiled on Sun's official Java compiler, perhaps). Sun could perform the official certifications test runs themselves to validate the tests pass with official unmodified tests, or grant that to an outside entity with whom they have an agreement to do such tests.

Translation (1)

jbellis (142590) | about 7 years ago | (#20186151)

"Suck it, IBM"
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>