|
|
.JARa's Bilingual Weblog
Life's better with NetBeans
|
|
|
(CS) -jdkhome nebo --jdkhome?
(

Pátek listopad 24, 2006 )
Včera jsem si nainstaloval Ubuntu verze 6.10 a chtěl jsem si spustit NetBeans. Default jdk na systému Ubuntu je ovšem 1.4.2, takže jsem napřed nainstaloval verzi 1.5.0 a pak jsem zkusil spustit poslední trunk build NetBeans na tomto jdk. Použil jsem proto příkazovou řádku, na které jsem NetBeansům předhodil zmíněnou verzi jdk. Celý příkaz vypadal asi takto:
/space/build/netbeans6.0/bin/netbeans -jdkhome /space/jdk1.5.0
Co mne ovšem hodně překvapilo byla následující výjimka a NetBeans se nespustily:
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)
Je poměrně obtížné zjistit, co je vlastně špatně. Vysvětlení je ovšem velice jednoduché. Přepínače mající více jak jedno písmeno se musí uvozovat "--". NetBeans totiž přestaly podporovat formát "-přepínač" a je tedy potřeba zadat "--přepínač" (přepínače ve tvaru "-přepínač" jsou ignorovány!). To platí zatím na unix, linux... zkrátka na Windows dočasně ještě fungují oba zápisy, ale pro jistotu doporučuji přejít na novou konvenci.
Takže až budete spouštět NetBeans z příkazové řádky, nezapomeňte, že --=+ (dvakrát minus je pro vás plus) .
|
|
|
Posted by jara
( XI 24 2006, 10:53:58 dop. CET )
Permalink
(EN) -jdkhome or --jdkhome?
(

Pátek listopad 24, 2006 )
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) .
|
|
|
Posted by jara
( XI 24 2006, 10:53:44 dop. CET )
Permalink
|
|
|
|
| Archives |
|
|
| « listopad 2006 » | | Po | Út | St | Čt | Pá | So | Ne |
|---|
| | | 1 | 2 | | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | | 25 | 26 | 27 | 28 | 29 | 30 | | | | | | | | | | | | | Today |
|
|
|
| Search |
|
|
|
|
|
|
| Contact |
|
|
Name: Jaromír Uhřík
E-mail: Jaromir.Uhrik@Sun.Com
ICQ: #265092035
RSS:
|
|
|
| Links |
|
|
|
|
|
| Visits map |
|
|
|
|
|
| Referrers |
|
|
|
Today's Page Hits: 101
|
|
|
|
|
|