This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes cannot find symbol Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "cannot find symbol" Watch "cannot find symbol" New topic
Author

cannot find symbol

mark smith
Ranch Hand

Joined: Apr 05, 2005
Posts: 246
hi

i used jaxb to generate some file

my xml file:

<?xml version="1.0" encoding="utf-8"?>
<jono>
<step>
<picture>tv.png</picture>
<word>
<definition lang="fr">t�l�vision</definition>
<definition lang="en">television</definition>
<definition lang="al">Fernsehen</definition>
</word>
</step>
<step>
<picture>stove.png</picture>
<word>
<definition lang="fr">po�le</definition>
<definition lang="en">stove</definition>
</word>
</step>
</jono>

jaxb generate me a class: jono, step, word, definition and objectfactory

in my folder generated, i try to build my main class:




i get this errors

TestJAXB.java:15: cannot find symbol
symbol : class Jono
location: class generated.TestJAXB
Jono jono = (Jono) unmarshaller.unmarshal(new File("jono.xml"));
^
TestJAXB.java:15: cannot find symbol
symbol : class Jono
location: class generated.TestJAXB
Jono jono = (Jono) unmarshaller.unmarshal(new File("jono.xml"));
^
TestJAXB.java:19: cannot find symbol
symbol : class Word
location: class generated.TestJAXB
Word word = (Word) step.get(i);
^
TestJAXB.java:19: cannot find symbol
symbol : class Word
location: class generated.TestJAXB
Word word = (Word) step.get(i);
^
TestJAXB.java:20: cannot find symbol
symbol : method getPicture()
location: interface java.util.List
System.out.println(step.getPicture());
^
Note: TestJAXB.java uses or overrides a deprecated API.
Note: Recompile with -Xlint eprecation for details.
5 errors


all my class it's present in my generated folder

any idea?

thanks
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Make sure that "generated" folder is in the CLASSPATH


[My Blog]
All roads lead to JavaRanch
mark smith
Ranch Hand

Joined: Apr 05, 2005
Posts: 246
i do

#mark@linux:~generated> javac -cp /opt/jaxb/jaxb-ri-20060426/lib/jaxb-impl.jar:/opt/jaxb/jaxb-ri-20060426/lib/jaxb-xjc.jar. TestJAXB.java
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
Remember that Java is case sensitive.
You may also need to compile the generated classes (if jaxp doesn't).


42
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Originally posted by mark smith:
#mark@linux:~generated> javac -cp /opt/jaxb/jaxb-ri-20060426/lib/jaxb-impl.jar:/opt/jaxb/jaxb-ri-20060426/lib/jaxb-xjc.jar. TestJAXB.java
Did you mean that the current working directory was in the classpath there? Well, it would be if you had a colon between "...jaxb-xjc.jar" and ".".
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cannot find symbol
 
Similar Threads
Need Help With JAXB Unmarshaller - Convert XML Back to Java Bean
Reading in XML into Objects
what is wrong with this code?
Sun JavaeeTutorial jaxB examples
read an write