Win a copy of Functional Design and Architecture this week in the Functional programming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Classpath problem.

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Greetings, Java Ranch.

I am compiling some ANTLR3 grammars and trying to link them with my main class, but to no avail.

Due to constraints imposed by a higher (insert evil adjective) authority, I am forced to use the following folder structure:

  • project/build/es/ull/etsii/pl/analyzers/ -> ANTLR3 generated .java & .class lie here.
  • project/lib/antlr-3.4-complete.jar
  • project/src/es/ull/etsii/pl/analyzers/ -> Grammar files lie here.
  • project/src/es/ull/etsii/pl/MainClass.java -> My main class.

  • Just to be precise, the grammar files are Analex and Anasyn, located in the package es.ull.etsii.pl.analyzers. When compiled, they are placed inside the build folder, within the same package.

    The main class imports both Analex and Anasyn specifically.

    I use ANT to manage the project, and compiling the grammar files works. Sadly compiling the main class fails because it cannot find the symbols for the lexer and the parser I already compiled, even though I am giving the correct classpath (I suppose). The baffling part is that, I have used the same build.xml to compile other projects with the same folder structure. The only difference is that I have migrated from ANTLR2 to ANTLR3.

    This is the target that fails:

    And this is the ant log:


    I hope I haven't forgotten something and that any of you guys can help me.

    By the way, removing or altering the package structure is not an option.
     
    Argenzul Kurosawa
    Greenhorn
    Posts: 2
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I am a complete idiot.

    ANTLR3 changed everything and the main class was struggling to locate a constructor that is not defined anymore. Change a few sentences in the main class and problem solved.
     
    Marshal
    Posts: 73953
    332
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Argenzul Kurosawa wrote:I am a complete idiot. . . ..

    No you aren’t. You solved an awkward problem there.

    And welcome to the Ranch
     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    reply
      Bookmark Topic Watch Topic
    • New Topic