• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Belgium

Java: Cannot find symbol error

4 posts in this topic

This has been driving me nuts for awhile.  I have an overloaded method which is located in a jar file.  This jar file has a number of common classes with are used by many other jar files.  The common jar file compiles without error.  I'll be calling it common.jar.

 

Whenever I try to use that method from detroit.jar I receive a "cannot find symbol" error.  Other usages of the method compile fine, just one specific version of the method gets the error message.

 

For example;
1. Foo.print(2, 3);
2. Foo.print(new File("x.txt"), 42);
3. Foo.print(false);
4. Foo.print("hi!");

 

Methods 1, 2 & 3 compile and work.  So my imports are there.  However, method 4 causes detroit.jar to fail compiling with the "cannot find symbol" error.  I know the method for #4 is there.  When I have Netbeans "goto source" it correctly finds the source method for #4.  When I "find usages" for #4 it correctly identifies the non-compiling usage of it so Netbeans knows it exists too.  The only difference between the first three working methods and the last method is the last method is new which seems to be key.

 

When I try to duplicate this problem from within a different jar, say chicago.jar, it compiles just fine.  So, there seems to be something specific between common.jar and detroit.jar which is conspiring to tick me off.  I've tried clean rebuild for both, no avail.  Renaming the #4 method gets the same error.  No changes I make in common.jar are being seen by detroit.jar.  However, those changes ARE seen by chicago.jar.  There are other jar files which detroit.jar imports and changes to those jar files compile/work just fine.  wtf.

 

Ideas?

0

Share this post


Link to post
Share on other sites
Instead of trusting your IDE's idea of "view source" and "find usages", which doesn't necessarily match runtime classpaths, you should look at actual class loading by running your tests with breakpoints in strategic places like java.lang.Class constructors. Where are you loading classes from? Did you put the "right" version of the problem class there?<br /><br />Another possible approach: run tests from a command prompt, with loose .class files instead of jars; they should work, and then you can reintroduce jar archives into your classpath one at a time (after rebuilding and checking their content properly) to see when the problem reappears.
1

Share this post


Link to post
Share on other sites

Thanks, LorenzoGatti.  I didn't quite understand what you were referring to and am still too ignorant to know if you were telling me the answer but you did send me down a path of investigation which resulted in a fix.

 

Anyways, I have made the problem go away.  I believe the problem is related to the build order of the jar files.  When I put "common.jar" at the top of the compile list the problem goes away.

 

My ignorant theory:

 

common.jar is used in many other jar files.  Many of those other jar files are also included in the problem file, "detroit.jar".  When I make a change to common.jar it isn't being seen by detroit.jar because an earlier .jar file has already been compiled which includes the non-editted version of the classes in common.jar.  It's this old version of the classes in common.jar that are being seen by detroit.jar.  The class is there but the new method is not.  New classes and methods are seen but new methods of previously existing classes are not. 

 

Odd thing is, after moving common.jar to the top of the compile list, compiling successfully, then moving common.jar to the bottom of the compile list, it still compiles fine so there's some understanding I still don't have here.  I can duplicate and resolve the problem at will at this point by adding new methods.

 

So, other than ensuring common.jar is always at the top of the compile list, is there a better way of avoiding this problem? 

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0