I work on linux.I have in /usr/local/netbeans-6.0/platform7/modulesthe file org-jdesktop-layout.jarWhen I try:$ javac -classpath /usr/local/netbeans-6.0/platform7/modules/org-jdesktop-layout.jar j*/*.javait fails:1. ERROR in javaapplication2/NewJFrame.java (at line 8)import org.jdesktop.layout.*;^^^^^^^^^^^^The import org.jdesktop cannot be resolved(javaapplication2/NewJFrame.java is a netbeans frame, and I cancompile itfrom inside netbeans perfectly, but I can not compile it using javacfrom commandline. That is the goal).I also tried to copy /usr/local/netbeans-6.0/platform7/modules/org-jdesktop-layout.jarinto /usr/lib/jvm/java-1.5.0-sun-1.5.0.10/jre/lib and /usr/lib/jvm/java-1.5.0-sun-1.5.0.10/jre/lib/ext,that dod not help.What can I do to get it resolved?Thanks!
|
|
0
|
|
|
|
Reply
|
vlenin66
|
12/29/2007 10:31:35 AM |
|
vlenin66 wrote:
> I work on linux.
> I have in /usr/local/netbeans-6.0/platform7/modules
> the file org-jdesktop-layout.jar
>
> When I try:
> $ javac -classpath /usr/local/netbeans-6.0/platform7/modules/org-
> jdesktop-layout.jar j*/*.java
>
> it fails:
> 1. ERROR in javaapplication2/NewJFrame.java (at line 8)
> import org.jdesktop.layout.*;
> ^^^^^^^^^^^^
> The import org.jdesktop cannot be resolved
> (javaapplication2/NewJFrame.java is a netbeans frame, and I can
> compile it
> from inside netbeans perfectly, but I can not compile it using javac
> from command
> line. That is the goal).
>
> I also tried to copy /usr/local/netbeans-6.0/platform7/modules/org-
> jdesktop-layout.jar
> into /usr/lib/jvm/java-1.5.0-sun-1.5.0.10/jre/lib and /usr/lib/jvm/
> java-1.5.0-sun-1.5.0.10/jre/lib/ext,
> that dod not help.
>
> What can I do to get it resolved?
$ jar tf $NETBEANS_HOME/platform7/modules/org-jdesktop-layout.jar
META-INF/
META-INF/MANIFEST.MF
org/
org/netbeans/
org/netbeans/libs/
org/netbeans/libs/layoutext/
org/netbeans/libs/layoutext/Bundle.properties
No sign that org.jdesktop.layout is in there. Maybe if you read the
MANIFEST.MF you'll discover that the layout manager is actually in
$NETBEANS_HOME/platform7/modules/ext/swing-layout-1.0.3.jar.
It doesn't do much good to copy a JAR without the JARs on which it depends.
--
Lew
|
|
0
|
|
|
|
Reply
|
Lew
|
12/29/2007 3:37:33 PM
|
|
vlenin66 wrote:>> I also tried to copy /usr/local/netbeans-6.0/platform7/modules/org->> jdesktop-layout.jar>> into /usr/lib/jvm/java-1.5.0-sun-1.5.0.10/jre/lib and /usr/lib/jvm/>> java-1.5.0-sun-1.5.0.10/jre/lib/ext,>> that dod not help.For God's sake, don't put your crap into the JVM lib/ directory, and avoid like heck putting it into the extensions.You should upgrade your Java. There was a security patch since that version - I think update 11 is the first of the Java 5s to get it. How come you're not using Java 6?-- Lew
|
|
0
|
|
|
|
Reply
|
Lew
|
12/29/2007 3:40:15 PM
|
|
On 29 Dez., 16:37, Lew <l...@lewscanon.com> wrote:
> vlenin66 wrote:
> > I work on linux.
> > I have in /usr/local/netbeans-6.0/platform7/modules
> > the file org-jdesktop-layout.jar
>
> > When I try:
> > $ javac -classpath /usr/local/netbeans-6.0/platform7/modules/org-
> > jdesktop-layout.jar j*/*.java
>
> > it fails:
> > 1. ERROR in javaapplication2/NewJFrame.java (at line 8)
> > import org.jdesktop.layout.*;
> > ^^^^^^^^^^^^
> > The import org.jdesktop cannot be resolved
> > (javaapplication2/NewJFrame.java is a netbeans frame, and I can
> > compile it
> > from inside netbeans perfectly, but I can not compile it using javac
> > from command
> > line. That is the goal).
>
> > I also tried to copy /usr/local/netbeans-6.0/platform7/modules/org-
> > jdesktop-layout.jar
> > into /usr/lib/jvm/java-1.5.0-sun-1.5.0.10/jre/lib and /usr/lib/jvm/
> > java-1.5.0-sun-1.5.0.10/jre/lib/ext,
> > that dod not help.
>
> > What can I do to get it resolved?
>
> $ jar tf $NETBEANS_HOME/platform7/modules/org-jdesktop-layout.jar
> META-INF/
> META-INF/MANIFEST.MF
> org/
> org/netbeans/
> org/netbeans/libs/
> org/netbeans/libs/layoutext/
> org/netbeans/libs/layoutext/Bundle.properties
>
> No sign that org.jdesktop.layout is in there. Maybe if you read the
> MANIFEST.MF you'll discover that the layout manager is actually in
> $NETBEANS_HOME/platform7/modules/ext/swing-layout-1.0.3.jar.
>
> It doesn't do much good to copy a JAR without the JARs on which it depends.
>
> --
> Lew
Lew, thanks for the reply.
It still does not work:
en@gepem:~/NetBeansProjects/JavaApplication2/src$ javac -classpath /
usr/local/netbeans-6.0/platform7/modules/ext/swing-layout-1.0.3.jar j*/
*.java
----------
1. ERROR in javaapplication2/NewJFrame.java (at line 8)
import org.jdesktop.layout.*;
^^^^^^^^^^^^
The import org.jdesktop cannot be resolved
swing-layout-1.0.3.jar shows org.jdesktop.layout using Ark.
Thanks!
|
|
0
|
|
|
|
Reply
|
vlenin66
|
12/29/2007 7:55:21 PM
|
|
On 29 Dez., 16:40, Lew <l...@lewscanon.com> wrote:> vlenin66 wrote:> >> I also tried to copy /usr/local/netbeans-6.0/platform7/modules/org-> >> jdesktop-layout.jar> >> into /usr/lib/jvm/java-1.5.0-sun-1.5.0.10/jre/lib and /usr/lib/jvm/> >> java-1.5.0-sun-1.5.0.10/jre/lib/ext,> >> that dod not help.>> For God's sake, don't put your crap into the JVM lib/ directory, and avoid> like heck putting it into the extensions.For Mysql connection that was the solution: I put my crap into JVM,andvoila, mysql worked.>> You should upgrade your Java. There was a security patch since that version -> I think update 11 is the first of the Java 5s to get it. How come you're not> using Java 6?>> --> LewI use linstalled knoppix, and it delivers java 1.5. I'd like to getthis work with java 1.5.I do not want to install anything new, since the given java programworks well with netbeans.The goal is, to get it work from command line.Thanks!
|
|
0
|
|
|
|
Reply
|
vlenin66
|
12/29/2007 8:00:14 PM
|
|
On 29 Dez., 11:31, vlenin66 <vleni...@hotmail.com> wrote:=2E.I found in the mean time, that Kaffe was also installed. If I useoriginaljava/javac, I can compile. Now the problem looks: HelloWorldworks fine, gui compiles, but fails with class not found.Here the details:HelloWorld program--------------------compile:-------en@gepem:~/NetBeansProjects/JavaApplication2/src$ /usr/lib/jvm/java-1.5.0-sun-1.5.0.10/bin/javac -cp /usr/local/netbeans-6.0/platform7/modules/ext/swing-layout-1.0.3.jar javaapplication2/Main.javaRun----en@gepem:~/NetBeansProjects/JavaApplication2/src$ /usr/lib/jvm/java-1.5.0-sun-1.5.0.10/bin/java javaapplication2.MainHello Hatty=FAHello ClassNotFound with swing layout classpath:-------------------------------------------------en@gepem:~/NetBeansProjects/JavaApplication2/src$ java -cp /usr/local/netbeans-6.0/platform7/modules/ext/swing-layout-1.0.3.jarjavaapplication2.MainException in thread "main" java.lang.NoClassDefFoundError:javaapplication2/MainGUI compiles:-------------en@gepem:~/NetBeansProjects/JavaApplication2/src$ /usr/lib/jvm/java-1.5.0-sun-1.5.0.10/bin/javac -cp /usr/local/netbeans-6.0/platform7/modules/ext/swing-layout-1.0.3.jar javaapplication2/NewJFrame.javaGui ClassNoFound with swing layout:-----------------------------------en@gepem:~/NetBeansProjects/JavaApplication2/src$ /usr/lib/jvm/java-1.5.0-sun-1.5.0.10/bin/java -cp /usr/local/netbeans-6.0/platform7/modules/ext/swing-layout-1.0.3.jar javaapplication2.NewJFrameException in thread "main" java.lang.NoClassDefFoundError:javaapplication2/NewJFrameen@gepem:~/NetBeansProjects/JavaApplication2/src$Gui ClassNoFound with swing layout:-----------------------------------en@gepem:~/NetBeansProjects/JavaApplication2/src$ /usr/lib/jvm/java-1.5.0-sun-1.5.0.10/bin/java javaapplication2.NewJFrameException in thread "main" java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$GroupThanks in advance!
|
|
0
|
|
|
|
Reply
|
vlenin66
|
12/29/2007 9:23:15 PM
|
|
On 29 Dez., 11:31, vlenin66 <vleni...@hotmail.com> wrote:Found the solution:when I say:java -cp /usr/local/netbeans-6.0/platform7/modules/ext/swing-layout-1.0.3.jar:.:./javaapplication2 javaapplication2.NewJFramethen gui works (also HelloWorld works like that).Thanks for the help, Happy End. :-)
|
|
0
|
|
|
|
Reply
|
vlenin66
|
12/29/2007 9:29:07 PM
|
|
Lew wrote:>> For God's sake, don't put your crap into the JVM lib/ directory, and avoid>> like heck putting it into the extensions.vlenin66 wrote:> For Mysql connection that was the solution: I put my crap into JVM,and> voila, mysql worked.Actually, that was most definitely not "the solution" but a maintenance nightmare a-borning. It was a workaround, and may have suppressed your symptoms, but it was no more a cure than aspirin is a cure for the flu even when it gets rid of the headache.Putting custom JARs in the JVM itself is bad. Putting them in the extensions directories is dangerous, and often bad unless the practitioner fully understands the consequences. Neither is really ever necessary - extensions directories exist so that you can, in effect, expand the Java language itself. Normal library references are better managed by using the classpath.In any event, you put the wrong JAR in there, so extensions, JVM lib/ or classpath doesn't matter.Please study the matter and learn why it's bad to put things in the JVM lib/ or extensions directories without full understanding.-- Lew
|
|
0
|
|
|
|
Reply
|
Lew
|
12/29/2007 9:32:09 PM
|
|
vlenin66 wrote:> It still does not work:> en@gepem:~/NetBeansProjects/JavaApplication2/src$ javac -classpath /> usr/local/netbeans-6.0/platform7/modules/ext/swing-layout-1.0.3.jar j*/> *.java> ----------> 1. ERROR in javaapplication2/NewJFrame.java (at line 8)> import org.jdesktop.layout.*;> ^^^^^^^^^^^^> The import org.jdesktop cannot be resolved> > swing-layout-1.0.3.jar shows org.jdesktop.layout using Ark.I'm going to assume that the line breaks in your posted command do not correspond to whitespace in the actual command line.It sure looks mysterious based on the information you have provided so far.Would you post the top part of your javaapplication2/NewJFrame.java source, from the top through the "class" declaration line?-- Lew
|
|
0
|
|
|
|
Reply
|
Lew
|
12/29/2007 9:39:40 PM
|
|
vlenin66 wrote:> Hello ClassNotFound with swing layout classpath:> -------------------------------------------------> > en@gepem:~/NetBeansProjects/JavaApplication2/src$ java -cp /usr/local/> netbeans-6.0/platform7/modules/ext/swing-layout-1.0.3.jar> javaapplication2.Main> Exception in thread "main" java.lang.NoClassDefFoundError:> javaapplication2/MainYou need to add "." to the classpath.> Gui ClassNoFound with swing layout:> -----------------------------------> > en@gepem:~/NetBeansProjects/JavaApplication2/src$ /usr/lib/jvm/> java-1.5.0-sun-1.5.0.10/bin/java -cp /usr/local/netbeans-6.0/platform7/> modules/ext/swing-layout-1.0.3.jar javaapplication2.NewJFrame> Exception in thread "main" java.lang.NoClassDefFoundError:> javaapplication2/NewJFrame> en@gepem:~/NetBeansProjects/JavaApplication2/src$You need to add "." to the classpath.> Gui ClassNoFound with swing layout:> -----------------------------------> > en@gepem:~/NetBeansProjects/JavaApplication2/src$ /usr/lib/jvm/> java-1.5.0-sun-1.5.0.10/bin/java javaapplication2.NewJFrame> Exception in thread "main" java.lang.NoClassDefFoundError: org/> jdesktop/layout/GroupLayout$GroupYou need to add the JAR and "." to the classpath.Also, could you (at least temporarily) add the Java 'bin/' directory to your PATH? All this line wrapping makes your stuff really hard to decipher.-- Lew
|
|
0
|
|
|
|
Reply
|
Lew
|
12/29/2007 9:45:03 PM
|
|
vlenin66 wrote:> On 29 Dez., 11:31, vlenin66 <vleni...@hotmail.com> wrote:> > Found the solution:> when I say:> java -cp /usr/local/netbeans-6.0/platform7/modules/ext/swing-> layout-1.0.3.jar:.:./javaapplication2 javaapplication2.NewJFrame> > then gui works (also HelloWorld works like that).'./javaapplication2' (or more simply, just 'javaapplication2') should not be part of the classpath, because it's part of the package structure.-- Lew
|
|
0
|
|
|
|
Reply
|
Lew
|
12/29/2007 9:46:16 PM
|
|
|
10 Replies
252 Views
(page loaded in 0.321 seconds)
|