noob starting

228 views
Skip to first unread message

Brian Wolf

unread,
Aug 7, 2010, 10:59:55 PM8/7/10
to zxing
Hi,

I'm excited about getting started with zxing, having just discovered
it, I'm fairly experienced with java. (although a little rusty),
although phone apps and bar codes are new to me.

I'm using cygwin, the build processes went fine,

javase.jar and core.jar are in their respective sub dirs

however I get this:

$ java -cp javase/javase.jar:core/core.jar
com.google.zxing.client.j2se.CommandLineRunner http://google.com/m

java.lang.NoClassDefFoundError: com/google/zxing/client/j2se/
CommandLineRunner
Caused by: java.lang.ClassNotFoundException:
com.google.zxing.client.j2se.CommandLineRunner
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

Thanks!

Brian










I

Sean Owen

unread,
Aug 8, 2010, 9:29:13 AM8/8/10
to zxing
That looks right to me. My best guess is that there is a Cygwin/
Windows issue here. Try using ';' instead of ':' as the classpath
separator?

Otherwise double-check that javase.jar built correctly? examine with
"jar tf javase.jar"

You're running from the project root, I take it.

Brian Wolf

unread,
Aug 9, 2010, 12:20:21 AM8/9/10
to zxing

well, I installed cygwin on the computer, so I have root
priviledges , I also chmod 777 the jar file

the javase.jar file has a size of 15135 bytes

and this seems to indicate it is in the jar file:

$ jar tf javase.jar

......

com/google/zxing/client/j2se/CommandLineRunner.class

.....




I rebuilt everything

(
ant -f core/build.xml
ant -f javase/build.xml
)

and....

$ java -cp javase/javase.jar:core/core.jar
com.google.zxing.client.j2se.CommandLineRunner http://www.google.com/m
java.lang.NoClassDefFoundError: com/google/zxing/client/j2se/
CommandLineRunner
Caused by: java.lang.ClassNotFoundException:
com.google.zxing.client.j2se.CommandLineRunner
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class:
com.google.zxing.client.j2se.CommandLineRunner. Program will exit.
Exception in thread "main"



Brian

Brian Wolf

unread,
Aug 9, 2010, 12:57:09 AM8/9/10
to zxing

I tried this on a linux system, and got this error

$ java -cp javase/javase.jar:core/core.jar
com.google.zxing.client.j2se.CommandLineRunner http://www.google.com/m
http://www.google.com/m: Could not load image

Brian

Sean Owen

unread,
Aug 9, 2010, 10:40:59 AM8/9/10
to zxing
So it is a Windows/Linux issue, because it works on Linux it seems.
Not sure exactly how to make the incantation work in Cygwin, but
that's outside the scope of this project -- it's a java-on-Cygwin
issue.

This error is correct: you're trying to decode a webpage, not an
image.

On Aug 8, 11:57 pm, Brian Wolf <brw...@gmail.com> wrote:
> I tried this on a linux system, and got this error
>
> $ java -cp javase/javase.jar:core/core.jar
> com.google.zxing.client.j2se.CommandLineRunnerhttp://www.google.com/mhttp://www.google.com/m:Could not load image

Bas Vijfwinkel

unread,
Aug 10, 2010, 3:21:58 AM8/10/10
to zxing
Maybe look at the cygwin manual.
I recall they had some issues regarding the usage of native windows
paths :
http://www.cygwin.com/cygwin-ug-net/using.html
If I remember correctly, one needs to define the paths differently
than the regular windows paths.

Maybe one question : Why use cygwin and not just java?
I just installed the regular Java SDK and all compiles fine.
The only downside is maybe the size of the java SDK itself.

Good luck!


On Aug 9, 4:40 pm, Sean Owen <sro...@gmail.com> wrote:
> So it is a Windows/Linux issue, because it works on Linux it seems.
> Not sure exactly how to make the incantation work in Cygwin, but
> that's outside the scope of this project -- it's a java-on-Cygwin
> issue.
>
> This error is correct: you're trying to decode a webpage, not an
> image.
>
> On Aug 8, 11:57 pm, Brian Wolf <brw...@gmail.com> wrote:
>
> > I tried this on a linux system, and got this error
>
> > $ java -cp javase/javase.jar:core/core.jar
> > com.google.zxing.client.j2se.CommandLineRunnerhttp://www.google.com/mhttp://www.google.com/m:Couldnot load image
Reply all
Reply to author
Forward
0 new messages