0

I am using the code from Rome's tutorials page http://wiki.java.net/twiki/bin/view/Javawsxml/Rome05TutorialFeedReader .

When I try to compile, it says class FeedReader is public, should be declared in a file named FeedReader.java.

I am new to Java, but I think that the FeedReader class should be part of the package used in the example, or in one of the import paths. I can't find file com.sun.syndication.samples (which is the package from the example) in the Rome library I downloaded. Any thoughts?

blaughli
  • 517
  • 5
  • 11
  • 27

1 Answers1

1

The code from your tutorial is

package com.sun.syndication.samples;

public class FeedReader {
    ...
}

It must be in a file named FeedReader.java and put in a directory com/sun/syndication/samples. If you change the name of the class, you must change also the name of the java file. If you change the package declaration, you must also change the location of the file.

Baldrick
  • 23,882
  • 6
  • 74
  • 79
  • Thanks. When you say "It must be in a file...", are you referring to the `FeedReader` class? Also, shouldn't it be included in the package? It seems like a bad tutorial if everything doesn't work like it should, but perhaps I am misunderstanding. – blaughli Feb 02 '12 at 20:11
  • My problem is that that directory does not exist, so it seems that the tutorial uses a package that does not come with the software download – blaughli Feb 02 '12 at 20:15
  • The code. You copy-paste the code from the tutorial into a file named FeedReader.java, create the directories if they don't exist. – Baldrick Feb 02 '12 at 20:15
  • Thanks, I'm getting there... Sortof feel like I'm chasing my own tail but this helps a lot. – blaughli Feb 02 '12 at 20:25