Java Help

Soldato
Joined
7 Apr 2004
Posts
4,212
Hey,

I've not worked with Java before, and I have a project from 1996 that I really need to get working :(

The source is here

These are the errors I get when trying to compile.

Code:
[jack@tmain Source]$ javac -classpath . -sourcepath . EzStego.java
EzStego.java:26: '.' expected
import ImageEncoder;
                   ^
EzStego.java:26: ';' expected
import ImageEncoder;
                    ^
EzStego.java:27: class, interface, or enum expected
import GifEncoder;
       ^
EzStego.java:28: '.' expected
import EzStegoEncoder;
                     ^
EzStego.java:28: ';' expected
import EzStegoEncoder;
                      ^
EzStego.java:29: class, interface, or enum expected
import DynamicFilterInputStream;
       ^
6 errors

Which come from this code:
Code:
import ImageEncoder;
import GifEncoder;
import EzStegoEncoder;
import DynamicFilterInputStream;

Can't work out why it doesn't like those imports, all their respective .java files are in the same directory, and ive tried compiling them first before the main file.

Anyone have any ideas? I have JDK and JRE installed, im unsure if it's a problem with my compilation environment (/ my lack of Java knowledge :p) or the very dated code :confused:

Thanks,

Jack
 
Thanks a lot, that got it to compile, but I cant get it to execute :(

Code:
[jack@tmain Source]$ java EzStego.class 
Exception in thread "main" java.lang.NoClassDefFoundError: EzStego/class
Caused by: java.lang.ClassNotFoundException: EzStego.class
	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: EzStego.class.  Program will exit.

Also tried specifying the class path with no success. Not sure why it cant find the EZStego class, which is defined in EZStego.java :(

I may have to run it with appletviewer rather than java though as it appears to be an applet? That however does nothing:

Code:
[jack@tmain Source]$ appletviewer EzStego.class
[jack@tmain Source]$ appletviewer -debug EzStego.class
Initializing jdb ...
> run
run sun.applet.Main EzStego.class
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
> 
VM Started: 
The application exited

EDIT: gam3r, haven't tried with an IDE yet. Will give Eclipse a try thanks.


EDIT2: All working :D just had to run it with java EzStego without the class extension. Thanks a lot for the help guys.
 
Last edited:
Back
Top Bottom