|
The exception is even telling you what's wrong:
Member 7991625 wrote: java.io.FileNotFoundException: /home/petterroea/.minecraft/bin/temp/META-INF/MOJANG_C.SF (No such file or directory)
File /home/petterroea/.minecraft/bin/temp/META-INF/MOJANG_C.SF is the problem, you need to create the folder /home/petterroea/.minecraft/bin/temp/META-INF before you can add anything to it...
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
How do i do that dynamically with multiple folders? I am thinking of something like removing /home/petterroea/.minecraft/bin/temp/
And splitting the rest by /
Then loop through the parent's contents to see if the folder exists...
|
|
|
|
|
You should be able to use theFile.mkdirs() .
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
I got the (Is a directory) error. How do i remove the file's name and only use the paths?
|
|
|
|
|
Try theFile.getAbsoluteFile().mkdirs()
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
I have compiled a java file but it does not have debug level information as LineNumberTable and LocalVariableTable , because of which my log file is not getting generated.
I want to know how can we have the debug information in the class file?
Any help !!
|
|
|
|
|
You need to tell your compiler to generate the debug information. Exactly how to do this depends on what development environment you are using. Here's how to do it in Eclipse (and it's probably pretty similar in other IDEs):
Project > Properties > Java Compiler > Classfile Generation
There are a number of checkboxes, including three you want. Check them and rebuild. Easy.
If you're using a standalone compiler, it will have command line switches. Run it with -? to see what they are.
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
Thanks for your reply Peter.
But the problem is not at IDE Level, I am tring to run a ANT script which is running on jdk 1.6 and generates a JAR file, when I see the class file it does not contain the debug level information(I am not running the ANT file from IDE , I have a Dmake file which calls the ANT script).
As per my understanding when the compiler compiles a java file, it puts the debug information in the class file, but they are missing in the class file.
Can it be because of some JVM or compiler setting??
|
|
|
|
|
Indrojeet wrote: Can it be because of some JVM or compiler setting??
Yes - a compiler setting, as I indicated in my previous reply. This is a cut'n'paste from javac.html - the docco for the javac compiler, which is probably what you are using.
-g
Generate all debugging information, including local variables. By default, only line number and source file information is generated.
-g:none
Do not generate any debugging information.
-g:{keyword list}
Generate only some kinds of debugging information, specified by a comma separated list of keywords. Valid keywords are:
source
Source file debugging information
lines
Line number debugging information
vars
Local variable debugging information
Looks like you have -g:none in an ANT buildfile or somewhere. Go find it and fix!
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
the current javac looks like this
<javac srcdir="${src}" destdir="${dest}">
<classpath refid="classpath" />
</javac>
Can you tell me how to include this -g in this ant script?
|
|
|
|
|
Sorry, I can't help you with this one, as I don't know my way around ANT. With any luck, someone who does know will see this thread and pick up from here. Maybe ask in another forum.
Good luck!
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
Hey Peter , i got the fix
added a attribute, debug="on"
Thanks
|
|
|
|
|
Hi
I wondered how i could:
1. Check if a file in a .jar file exists
2. Delete files from a .jar
3. add files to a .jar
4. Delete folders from a .jar
I can't find any documentation on this by searching!
|
|
|
|
|
You can't have looked very hard. Googling "jar file format" gave me almost 4.5 million results, the first one of which is this Wikipedia entry[^].
As it says, a jar file is basically a zip file with some descriptive stuff in a file called META-INF\MANIFEST.MF. So, grab your favourite zip tool and text editor and go for it.
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
When i try, i get a java.io.FileNotFoundException: META-INF/XXXXXX_X.SF (No such file or directory)
|
|
|
|
|
I don't think you searched very far, a simple Google search for "jar command" led to this[^].
The best things in life are not things.
|
|
|
|
|
I ned a command to use in code, not command line
|
|
|
|
|
See the third link here[^]; it was really not too difficult to find.
The best things in life are not things.
|
|
|
|
|
Doesn't that article only have info about console commands? I need a source code sequence that extracts the jar
|
|
|
|
|
Did you bother to read the link[^] I pointed you to? It contains all the details you need. Or are you waiting for someone else to write the code for you?
The best things in life are not things.
|
|
|
|
|
Ah, the third link for me was something else. Thanks!
|
|
|
|
|
Hi,everyone:
I'm a new developer with java.I want some projects for ssh+extjs. Before,I used ssh to build B/S programs.But, I'm not use extjs in programs once. I hope someone can help me. Thanks.
|
|
|
|
|
FariyEye wrote: B/S programs
Yeah, I've built a few of those in my time too...
Can you be a bit more explicit about what you mean when you say that you want to use ExtJS in a Java program? ExtJS is a javascript library for front-end browser development. Do you mean that you are writing a web app and want to know how to use ExtJS with JSPs, servlets, JSF, whatever?
|
|
|
|
|
Hi,
I have taken over a J2EE application and there are a lot of files that I don't believe are being used (some I know aren't). I don't normally do much Java or J2EE development so I'm wondering if anyone can let me know if there is something out there that can tell me what files aren't being used by the application. I'm using Eclipse Helios as my IDE.
For example, in Visual Studio apparently you can do the following:
In the Solution Explorer you can select the project node and click on the Show All Files button.
You will then see files and folders not referenced by the project as grayed out.
Taken from http://stackoverflow.com/questions/5889082/find-files-not-referenced-by-project-vs-2010[^]
Is there something similar in Eclipse and I just haven't found it yet?
"The computer industry is the only industry that is more fashion-driven than women's fashion. Maybe I'm an idiot, but I have no idea what anyone is talking about. What is it? It's complete gibberish. It's insane. When is this idiocy going to stop?" -- Oracle CEO Larry Ellison
|
|
|
|
|
In your IDE go to:
Windows -> Preferences -> Java -> Compiler -> Errors/Warnings -> unnecessary code
You'll find quite some options there. The Reult can be seen in the Problems-View (Windows -> Views).
regards
Torsten
I never finish anyth...
|
|
|
|