Help building application  
Author Message
Adam





PostPosted: 2005-9-12 11:53:00 Top

java-programmer, Help building application Hello,

I am fairly new to Java. I recently switched from C++ to Java for a
project I am working on. I was looking for a decent HTML parser when I came
across the htmlparser 1.5 project on Sourceforge.net. I understand the
logic, but I am having build problems with my own classes. If I put my class
in the jar file along with all the other parser classes, everything works
well, but I prefer not to do it that was. When I have a separate .class file
and try to run it through the JVM I get the following error:
"java.lang.NoClassDefFoundError: AdamParser (wrong name:
org/htmlparser/AdamParser)". All I want to do is test my ideas the simplest
way possible. I was hoping some more experienced Java programmer could help
me.

TIA,
Adam


 
Roedy Green





PostPosted: 2005-9-12 13:32:00 Top

java-programmer >> Help building application On Sun, 11 Sep 2005 22:53:29 -0500, "Adam" <email***@***.com>
wrote or quoted :

>I am fairly new to Java. I recently switched from C++ to Java for a
>project I am working on. I was looking for a decent HTML parser when I came
>across the htmlparser 1.5 project on Sourceforge.net. I understand the
>logic, but I am having build problems with my own classes. If I put my class
>in the jar file along with all the other parser classes, everything works
>well, but I prefer not to do it that was. When I have a separate .class file
>and try to run it through the JVM I get the following error:
>"java.lang.NoClassDefFoundError: AdamParser (wrong name:
>org/htmlparser/AdamParser)". All I want to do is test my ideas the simplest
>way possible. I was hoping some more experienced Java programmer could help
>me.

If you want multiple jars, you must insert a reference to the
additional jars inside the first jar's manifest Class-Path entry.
You also might want to include an index to all the jars in the first
jar.

See http://mindprod.com/jgloss/jar.html
http://mindprod.com/jgloss/jarexe.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
 
Adam





PostPosted: 2005-9-13 1:09:00 Top

java-programmer >> Help building application Hello Roedy,

What I was hoping for was to use the Java HTML Parser just like a library
in any other language (i.e. C, C++) where I have my own file or files that
get linked with the library. The only way I can get this to work is to put
my new class file into the Jar file. It works, but it is inconvenient for
me. I can compile my classes OK, but I can't run them.

Thanks,
Adam



"Roedy Green" <email***@***.com> wrote in message
news:email***@***.com...
> On Sun, 11 Sep 2005 22:53:29 -0500, "Adam" <email***@***.com>
> wrote or quoted :
>
>>I am fairly new to Java. I recently switched from C++ to Java for a
>>project I am working on. I was looking for a decent HTML parser when I
>>came
>>across the htmlparser 1.5 project on Sourceforge.net. I understand the
>>logic, but I am having build problems with my own classes. If I put my
>>class
>>in the jar file along with all the other parser classes, everything works
>>well, but I prefer not to do it that was. When I have a separate .class
>>file
>>and try to run it through the JVM I get the following error:
>>"java.lang.NoClassDefFoundError: AdamParser (wrong name:
>>org/htmlparser/AdamParser)". All I want to do is test my ideas the
>>simplest
>>way possible. I was hoping some more experienced Java programmer could
>>help
>>me.
>
> If you want multiple jars, you must insert a reference to the
> additional jars inside the first jar's manifest Class-Path entry.
> You also might want to include an index to all the jars in the first
> jar.
>
> See http://mindprod.com/jgloss/jar.html
> http://mindprod.com/jgloss/jarexe.html
> --
> Canadian Mind Products, Roedy Green.
> http://mindprod.com Again taking new Java programming contracts.


 
 
Raymond DeCampo





PostPosted: 2005-9-14 2:32:00 Top

java-programmer >> Help building application Adam wrote:
> Hello Roedy,
>
> What I was hoping for was to use the Java HTML Parser just like a library
> in any other language (i.e. C, C++) where I have my own file or files that
> get linked with the library. The only way I can get this to work is to put
> my new class file into the Jar file. It works, but it is inconvenient for
> me. I can compile my classes OK, but I can't run them.
>

Please do not top post, especially in reply to a bottom posted reply.

It sounds like you are having classpath issues. Consult Roedy's site
for information on classpath (see links below).


>
>
> "Roedy Green" <email***@***.com> wrote in message
> news:email***@***.com...
>
>>On Sun, 11 Sep 2005 22:53:29 -0500, "Adam" <email***@***.com>
>>wrote or quoted :
>>
>>
>>>I am fairly new to Java. I recently switched from C++ to Java for a
>>>project I am working on. I was looking for a decent HTML parser when I
>>>came
>>>across the htmlparser 1.5 project on Sourceforge.net. I understand the
>>>logic, but I am having build problems with my own classes. If I put my
>>>class
>>>in the jar file along with all the other parser classes, everything works
>>>well, but I prefer not to do it that was. When I have a separate .class
>>>file
>>>and try to run it through the JVM I get the following error:
>>>"java.lang.NoClassDefFoundError: AdamParser (wrong name:
>>>org/htmlparser/AdamParser)". All I want to do is test my ideas the
>>>simplest
>>>way possible. I was hoping some more experienced Java programmer could
>>>help
>>>me.
>>
>>If you want multiple jars, you must insert a reference to the
>>additional jars inside the first jar's manifest Class-Path entry.
>>You also might want to include an index to all the jars in the first
>>jar.
>>
>>See http://mindprod.com/jgloss/jar.html
>>http://mindprod.com/jgloss/jarexe.html
>>--
>>Canadian Mind Products, Roedy Green.
>>http://mindprod.com Again taking new Java programming contracts.
>
>
>

HTH,
Ray

--
XML is the programmer's duct tape.