This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Trouble compiling simple website crawler Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Trouble compiling simple website crawler" Watch "Trouble compiling simple website crawler" New topic
Author

Trouble compiling simple website crawler

Frank Metzger
Greenhorn

Joined: Aug 04, 2011
Posts: 6
I am trying to get this simple webcrawler to work. I think it prints the HTML source line by line. Currently, it doesn't print any of the statements. I hope you can help.

Here is the code:


I get pre-compile errors for the following statements: import java.io.BufferedReader; "Incorrect Package" and package grabHTML; "class, interface or enum expected"

I get the following errors after compiling:
java.lang.NoClassDefFoundError: grabhtml/GrabHTML
Caused by: java.lang.ClassNotFoundException: grabhtml.GrabHTML
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:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: grabhtml.GrabHTML. Program will exit.
Exception in thread "main" Java Result: 1






Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4442
    
    5

The package statement needs to be before any import statements


Junilu - [How to Ask Questions] [How to Answer Questions]
 
 
subject: Trouble compiling simple website crawler
 
Similar Threads
NoClassDefFoundError: wrong name
Exception in thread "main" java.lang.NoClassDefFoundError: kolos/Main
File path issues while reading an xsl file in java
Gives me error when included in the same folder but works when outside folder
FileNotFoundException