Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Package not exist..

Reply
Thread Tools

Package not exist..

 
 
Ray Bohnenberger
Guest
Posts: n/a
 
      09-29-2003
Hi.. im really new to java and my first try iss to load an image..
now i use Tif-images.. but the first lines are my first errors..

>rb_tiffload.java:3: package com.multiconn.fop.codec does not exist
>import com.multiconn.fop.codec.TIFFCodec;
> ^


i have tried to load the TIFFCodec through:
- import net.sourceforge.jiu.codecs.TIFFCodec;
- import com.multiconn.fop.codec.TIFFCodec;

both failed with the message above.. what am i doing wrong? can anyone help
me?

how i compile: "javac rb_tiffload.java"


 
Reply With Quote
 
 
 
 
Tor Iver Wilhelmsen
Guest
Posts: n/a
 
      09-29-2003
"Ray Bohnenberger" <(E-Mail Removed)> writes:

> how i compile: "javac rb_tiffload.java"


You probably need to use

javac -classpath theExtraClassesYouUse.jar rb_tiffload.java
 
Reply With Quote
 
 
 
 
Ray Bohnenberger
Guest
Posts: n/a
 
      09-29-2003
> You probably need to use

>


> javac -classpath theExtraClassesYouUse.jar rb_tiffload.java


thx. this was all i needed.. but now i have another problem with java..

javac builds class without error, and java gets error: Exception in thread
"main" java.lang.NoClassDefFoundError: net/sourceforge/jiu/codecs/ImageCodec

without line or error or anything else..


 
Reply With Quote
 
secret
Guest
Posts: n/a
 
      09-29-2003
You got this error because the jar you referenced with the classpath
variable was using another jar with the class

net.sourceforge.jiu.codecs.ImageCodec

Doing a google search on "sourceforge imagecodec jar" tells me that this is
the jiu.jar. So make sure you also include that in your classpath.

good luck

alan


"Ray Bohnenberger" <(E-Mail Removed)> wrote in message
news:bl9ui4$odr$(E-Mail Removed)-Aachen.DE...
> > You probably need to use

>
> >

>
> > javac -classpath theExtraClassesYouUse.jar rb_tiffload.java

>
> thx. this was all i needed.. but now i have another problem with java..
>
> javac builds class without error, and java gets error: Exception in thread
> "main" java.lang.NoClassDefFoundError:

net/sourceforge/jiu/codecs/ImageCodec
>
> without line or error or anything else..
>
>



 
Reply With Quote
 
Ray Bohnenberger
Guest
Posts: n/a
 
      09-29-2003
> You got this error because the jar you referenced with the classpath
> variable was using another jar with the class
>
> net.sourceforge.jiu.codecs.ImageCodec
>
> Doing a google search on "sourceforge imagecodec jar" tells me that this

is
> the jiu.jar. So make sure you also include that in your classpath.


thats right.. i've changed my code a little.. so i write the whole prob
here..

i wrote in iq.java:
import net.sourceforge.jiu.codecs.ImageCodec;
import net.sourceforge.jiu.codecs.BMPCodec;

then in line 33 i use:
ImageCodec codec = new BMPCodec();

then i compile:
c:\programme\j2sdk\bin\javac -classpath jiu.jar iq.java

without error and when i ran:
c:\programme\j2sdk\bin\java iq 161.bmp 161_iq.bmp 30 10 512 512

i get the error:
Exception in thread "main" java.lang.NoClassDefFoundError:
net/sourceforge/jiu/codecs/BMPCodec
at iq.main(iq.java:33)

thats my problem.. so i always included the .jar in my classpath.. but i
dunno why..


 
Reply With Quote
 
Tor Iver Wilhelmsen
Guest
Posts: n/a
 
      09-29-2003
"Ray Bohnenberger" <(E-Mail Removed)> writes:

> javac builds class without error, and java gets error: Exception in thread
> "main" java.lang.NoClassDefFoundError: net/sourceforge/jiu/codecs/ImageCodec


You need the -classpath stuff when running java also...
 
Reply With Quote
 
Tor Iver Wilhelmsen
Guest
Posts: n/a
 
      09-29-2003
"Ray Bohnenberger" <(E-Mail Removed)> writes:

> then i compile:
> c:\programme\j2sdk\bin\javac -classpath jiu.jar iq.java
>
> without error and when i ran:
> c:\programme\j2sdk\bin\java iq 161.bmp 161_iq.bmp 30 10 512 512


In Java, the compiler does not link statically the jars referenced,
you need to supply them in the classpath at tunrime as well.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Package HTML - Missing package documentation file jochenhebbrecht@gmail.com Java 1 11-27-2007 01:59 PM
Package that imports with name of dependent package David Pratt Python 4 05-13-2006 05:12 PM
single package import v/s the entire package Parvinder Java 6 02-27-2005 02:02 PM
package module import name clash with global package George P Python 3 09-11-2004 01:19 PM
Importing a package and looping through modules in the package Dave Python 2 02-10-2004 08:14 PM



Advertisments