.JARa's Bilingual Weblog

Life's better with NetBeans
photo of Jara

(EN) -jdkhome or --jdkhome? ( 20061124 Pátek listopad 24, 2006 )
English flag Yesterday I installed version 6.10 of Ubuntu and then tried to run NetBeans. But the default jdk on this system is 1.4.2 so that I installed version 1.5.0 first and then I tried to run last trunk build of NetBeans on this jdk. I wrote on command-line command like following (with specified jdkhome switch I tried to pass path to my jdk):
/space/build/netbeans6.0/bin/netbeans -jdkhome /space/jdk1.5.0
I was confused by the following exception and the NetBeans did not start:

Exception in thread "main" java.lang.NoSuchMethodError: method java.lang.Class.cast with signature (Ljava.lang.Object;)Ljava.lang.Object; was not found.
at org.openide.util.WeakSet.checkRefQueue(WeakSet.java:282)
at org.openide.util.WeakSet.object2Entry(WeakSet.java:315)
at org.openide.util.WeakSet.add(WeakSet.java:117)
at org.openide.util.lookup.MetaInfServicesLookup.beforeLookup(MetaInfServicesLookup.java:99)
at org.openide.util.lookup.AbstractLookup$R.allInstances(AbstractLookup.java:882)
at org.openide.util.Lookup.lookupAll(Lookup.java:215)
at org.netbeans.MainImpl$BootClassLoader.allCLIs(MainImpl.java:303)
at org.netbeans.CLIHandler.initialize(CLIHandler.java:325)
at org.netbeans.MainImpl.execute(MainImpl.java:162)
at org.netbeans.MainImpl.main(MainImpl.java:55)
at org.netbeans.Main.main(Main.java:53)

It is hard to find out where the problem is. The explanation is pretty easy. Switches longer than 1 letter must have prefix "--". NetBeans stopped supporting format "-switch" and it is necessary to pass "--switch" (switch in format "-switch" are ignored!). This is true for unix, linux... simply on Windows it work temporarily both formats but i suggest adapting to the new convention for sure.
So if you are running NetBeans from command line don't forget that --=+ (twice minus is plus for you)smile.
Posted by jara ( XI 24 2006, 10:53:44 dop. CET ) Permalink Comments [1]


Trackback URL: http://blogs.sun.com/jara/entry/%28en%29_-jdkhome_or_--jedkhome%3F
Comments:

$^&@## != x.tU'f

Posted by Lukas on listopad 26, 2006 at 08:40 odp. CET #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed
Archives
Search
Contact
Links
Visits map
Referrers

   Disclaimer: This blog contains my own opinions which may differ from viewpoints of Sun Microsystems.