Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cannot find symbol

 
mark smith
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure that "generated" folder is in the CLASSPATH
 
mark smith
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remember that Java is case sensitive.
You may also need to compile the generated classes (if jaxp doesn't).
 
Paul Clapham
Sheriff
Pie
Posts: 20966
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ".".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic