aph is currently certified at Master level.

Name: Andrew Haley
Member since: 2005-09-26 10:00:55
Last Login: 2012-12-21 17:17:03

FOAF RDF Share This

No personal information is available.

Articles Posted by aph

Recent blog entries by aph

Syndication: RSS 2.0
23 Oct 2012 (updated 23 Oct 2012 at 16:42 UTC) »

We're doing an ARM64 OpenJDK port! Article at
http://www.advogato.org/article/1067.html

20 Feb 2009 (updated 20 Feb 2009 at 17:17 UTC) »

I wrote an article: Shark, gcj, and HotSpot: A tale of three code generators. Article at http://www.advogato.org/article/1001.html

Boy, do I feel stupid. As soon as I posted my blog, people pointed out to me that NetBeans 6.0 Beta 2 supports IcedTea out of the box, so all my hackery with NetBeans 5.5 was pointless.

However, NetBeans 6.0 Beta 2 doesn't work for me. It just displays a blank screen. After a little while, I've found out why. I always run all my test programs as X clients on a remote mcahine, with the server running on my desktop machine. It turns out that if you start 6.0 Beta 2 on the same machine as the X server, it displays correctly.

I suppose that NetBeans must be doing some of the same weird stuff that we've seen elsewhere, and trying to bypass part of the X protocol somehow.

Download netbeans 5.5 from

http://www.netbeans.info/downloads/

OK, run the netbeans installer.

No Java Development Kit(JDK) was found on this system.

Oh dear.

zorro:~ $ java -version
java version "1.7.0"
IcedTea Runtime Environment (build 1.7.0-kojibuilder_27_sep_2007_14_56-b00)
IcedTea Server VM (build 11.0-b05, mixed mode)

OK, so it is there. Looks like the netbeans installer really doesn't like IcedTea.

Try with an old JDK 1.5 version.
Run the netbeans installer. Ah, that's much better!

Initializing InstallShield Wizard........
Launching InstallShield Wizard........

Right, so we have netbeans installed.

zorro:~ $ ./netbeans-5.5.1/bin/netbeans

That works fine. Okay, so let's try running that with IcedTea in --jdkhome rather than Java 1.5:

zorro:~ $ sh -x ./netbeans-5.5.1/bin/netbeans --jdkhome /usr/lib/jvm/java-1.7.0-icedtea-1.7.0.0.x86_64

Alright! That seems to work perfectly. Let's try "Hello, World"

init:
deps-jar:
compile:
run:
Exception in thread "main" java.lang.UnsupportedClassVersionError: javaapplication1/Main : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:638)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:143)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:281)
at java.net.URLClassLoader.access$000(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:216)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:209)
at java.lang.ClassLoader.loadClass(ClassLoader.java:324)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:269)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:337)
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)

Excuse me? What is *that* all about? I'm running on a Java 1.7 VM and compiling on a Java 1.7 VM, but the class file version is wrong. Bizarre.

Let's try that from the command line, so we can see what's going on:

zorro:src $ /usr/lib/jvm/java-1.7.0-icedtea-1.7.0.0.x86_64/bin/javac javaapplication1/Main.java
zorro:src $ java javaapplication1.Main
Hello, world!

So, that works. Let's have a look at the class file version:

zorro:src $ jcf-dump javaapplication1/Main
Reading .class from ./javaapplication1/Main.class.
Magic number: 0xcafebabe, minor_version: 0, major_version: 50.

Hey, it looks like IcedTea's javac defaults to emitting .class files with the Java 1.6 major version. What happens with Java 1.7 and IcedTea's VM?

zorro:src $ /usr/lib/jvm/java-1.7.0-icedtea-1.7.0.0.x86_64/bin/javac -source 1.7 javaapplication1/Main.java
zorro:src $ /usr/lib/jvm/java-1.7.0-icedtea-1.7.0.0.x86_64/bin/java javaapplication1/Main
Exception in thread "main" java.lang.UnsupportedClassVersionError: javaapplication1/Main : Unsupported major.minor version 51.0

Ouch! So, although IcedTea is in theory Java 1.7 its VM will refuse to run .class files in the 1.7 format. Netbeans must be forcing Version 1.7.

OK, right-clock on Project/Properties, and there it is:

Source Level: 1.7

Change that to 1.6, Clean and Build Main Project:

init:
deps-jar:
compile:
run:
Hello, world!
BUILD SUCCESSFUL (total time: 0 seconds)

Alright, so that works. IcedTea is now running netbeans.

As far as I can see everything works perfectly, except for some small font rendering issues. The only real problem is that the netbeans installer won't recognized IcedTea as a valid Java VM, so you have to have Java 1.5 (an unfree VM) installed somewhere to install. Once netbeans is installed you can delete Java 1.5.

We really need to fix this; you shouldn't have to install an unfree JDK to run netbeans on IcedTea.

OK, now I'll try the NetBeans 6.0 beta.

Umm, beaten by Dalibor on both the economic _and_ social liberal scale! I got a mere 80%/20% split. I'm not sure how Dalibor managed to beat me on the social scale. Must try to improve...

1 older entry...

 

Others have certified aph as follows:

  • rmathew certified aph as Master
  • mjw certified aph as Master
  • robilad certified aph as Master
  • gary certified aph as Master
  • bonzini certified aph as Master
  • kclayton certified aph as Master
  • adl certified aph as Master
  • redi certified aph as Journeyer
  • audriusa certified aph as Master
  • gnuandrew certified aph as Master
  • graydon certified aph as Master

[ Certification disabled because you're not logged in. ]

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!

X
Share this page