listen, start reading basic java tutorials and books, something in general about java language. Only when you know the basics you should come back and try to make a game. This is a forum for developing games in java, we won't teach you how to program java here.

About your error, you are trying to use a method that does not exist. Like, it's not there, you didn't wrote/code it.

listen, start reading basic java tutorials and books, something in general about java language. Only when you know the basics you should come back and try to make a game. This is a forum for developing games in java, we won't teach you how to program java here.

//----------------------

'listen, start reading basic java tutorials and books.. blahblah..' well, that was a good advice, thanks, as i am a very novice on Java i need to know where to start,what sites do you people recommend to me and what sites are good to take to my bookmarks, thanks.

'...only when you know basics you should come back and try to make a game..' well, this was an bit of a unpolite from you, and knowing basics is a complicated thing,i can say to you that i do know a basics about game programming but i just dont knowhow to read a file from a Java '/build/class/' directory getCodeBase () didnt work..

'..This is a forum for developing games in java, we won't teach you how to program java here..' well, im after a game and what i think is that people do teach how to program Java in here(bufferedimage is a popular thing on this forum then why not 'FileInputStream')??

and cos ya were thinking that i cant make a real game then here is one for you its my visualc++ cavegame and im doingit currently to Java hopely you like it, i need to know how to read those level files from my '/build/classes' directory tomake my Java version roll with those old c++ levels....www.5mingames.eurojari.net/CaveGame99.zip

hope you liked it, i will publish it on my webpage later, i made it at 1999, if you played my gameyou can understand that i can say that i am a hobby game developer and i just need to learn some basics, liked you said, of Java and i was thinking that this forum would be right place to start doing it and doing it withreal people, hopely i was not wrong,

When trivial errors like this are a showstopper for you, it won't help when we give you the solution, you'd - unfortunately - bump right into the next trivial error.

Get yourself a nice Java book, and believe me, there are only a few really good ones. Try one that doesn't mention AWT/Swing at all, because it will only get in the way when learning the basics (i'm dead-serious about this). Command-line applications is the way to go. Once you know all about Java, it's time to build some GUIs.

Goodluck!

Hi, appreciate more people! Σ ♥ = ¾Learn how to award medals... and work your way up the social rankings!

I was a bit rude, but I think I had right to be rude in this instance. At the end I told you what the problem is. If it's about File I/O or something like that I would reply nicely, but you don't know how to use methodes (functions), and that's basics of basics, not just for java but for all programming. Second, java compiler told you exactly what is wrong, but you don't know how to read errors also. So although you have some experience in programming (didn't try your game) you have not enough experience in java to code ... well... pretty much anything. I'm not trying to be rude here, just speaking the truth as I see it.

What helped me the most when I was starting out with java is free e-book: Thinking in Java by Bruce Eckel. I had 3rd edition and it is free, but I think 4th edition isn't free anymore. Thinkin in java is for begginers in java that have basic programming experience. Try www.bruceeckel.com, maybe you can still download 3rd edition for free.EDIT: ...3rd edition is still there, here is direct link to zip file

My first post was a bit miss leading, sorry for that, as im not that beginner what it lets people to understand, sorry, i just havent made IO routines with Java, ever.

i can build many different types of games with c++ and some with Java, but, liked i said, i havent made Java IO routines, ever, and would really presiate ifsomeone could help me a bit..

the problem is that i dont know how to read a data file from a path where .CLASS files are..in c++ if you want to load a file from a directory where .exe file is launched you simply use "thefilename.dat" and nothing else this seems not to be true with java if i put a line to my code.. in = new FileInputStream ("input.txt");i receive an error even if my 'input.txt' is on my .CLASS directory, why..

code works fine but when i change the line in = new FileInputStream ("c:/input.txt");to in = new FileInputStream ("input.txt");to load file 'input.txt' from where the .class files are, i receive an 'file not found', why from where is Java loading 'input.txt' when there is no path included?? c++ loads where the .exe is

java.io.FileNotFoundException: input.txt (The system cannot find the file specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:106) at java.io.FileInputStream.<init>(FileInputStream.java:66) at MultiBufferTest.copyBytes(MultiBufferTest.java:84) at MultiBufferTest.<init>(MultiBufferTest.java:106) at MultiBufferTest.main(MultiBufferTest.java:184)

thanks Riven, i now get my "input.txt" file to be loaded from the same directory where my executable jar file is launched..

my new questions are - how to modify the code to make the "input.txt" file to be loaded inside the jar secondly is it possible to write a file "output.txt" to a jar and finally, if im using NetBeans IDE 5.5 how to modify the code to make my application run without errors from IDE when "input.txt" is located at '/build/classes/' directory ??

You can access files that are located in the classpath using a ClassLoader. More specifically you can use the methods ClassLoader#getSystemResourceAsStream or ClassLoader#getResourceAsStream.As far as I know j2se doesn't provide any API to update an existing jar file. It's pretty straightforward to create a new one though using a JarOutputStream.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org