Package not exist..

R

Ray Bohnenberger

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"
 
T

Tor Iver Wilhelmsen

Ray Bohnenberger said:
how i compile: "javac rb_tiffload.java"

You probably need to use

javac -classpath theExtraClassesYouUse.jar rb_tiffload.java
 
R

Ray Bohnenberger

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..
 
S

secret

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
 
R

Ray Bohnenberger

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..
 
T

Tor Iver Wilhelmsen

Ray Bohnenberger said:
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...
 
T

Tor Iver Wilhelmsen

Ray Bohnenberger said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,088
Latest member
JeremyMedl

Latest Threads

Top