netcom_ wrote:How do you run it? If you are not running it from the command line, do that - any output should appear on the prompt.
...I get the jar file and when I run this jar file ,...
but also it doesn't find the file.
InputStream is = getClass().getResourceAsStream("/test.txt"); byte buffer = new byte; String lin= is.read(buffer); is.close();
netcom_ wrote:Huh?!? Since InputStream.read(byte) returns an int, I do not understand how that compiles, let alone runs.
I found the error;I have a file.txt under the bin of the project,but when I export the project this file
don't appear so when I run the jar it doesn't find the file.this file is neccessery for the project.
I will read the content of this file,So I think after exporting the project I make it with the jarfile and I use this code to read the file.
... String lin= is.read(buffer); ..
but also it doesn't find the file.When reporting problems, please [copy/paste any error messages|http://pscode.org/javafaq.html#exact] you are getting.
netcom_ wrote:You replied to my post. I cannot see why, since you seem to have veered off into some entirely separate topic.
I want that when I extract the jarfile ,I found the file .txt under it(like plugins,src,.project,.classpath..)