|
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...
|
|
|
|
|
I'm not quite sure that's what the OP wants. Things that are accessible where you mentioned like unused imports are (or can be) highlighted in the IDE (and the common ones are highlighted by default). I think what he's looking for is unused references to other packages/projects on the build path and so on. Maybe OP can clarify what he's after. If it's what I think it is, I don't know of any way other than foreach (package_reference in project) {remove_package; rebuild; check_for_errors} which is a bit painful, and probably why he asked.
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
It may not be that straight-forward if your project is using reflection. Suppose you do something like:
Class myClass = Class.forName("com.mycompany.stuff.MyThing");
If you remove the com.mycompany.stuff package from the project, this will still compile with no errors. But when it runs it will collapse in a smoking heap. (If you are using JUnit properly, that should catch it but even so, it's not a real solution.)
This could be a problem if you are using Spring, for example, which uses reflection to instantiate beans.
Or there may be files that need to be in your project (e.g. log4j.properties) that are not referenced directly by your own code, but are required for some third party library you are using. Yes, you can set up the log4j.properties file (or log4j.xml if you prefer) at deployment time but most projects I've seen include it in the build for convenience. Hibernate config files are another example that springs to mind.
I'm not sure that Java has the same concept of "referenced files" that .NET does. An awful lot is just picked up off the classpath at runtime. That makes it quite a bit harder to figure out which files are really "unreferenced".
|
|
|
|
|
You're right, of course. Once reflection rears its ugly (but occasionally beautiful ) head all bets are off, at least in terms of knowing where your code came from.
I don't think that things picked up from the classpath are a big issue here (but of course one'll pop up to make a liar of me!)
Have a 5!
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
What Torsten mentioned should be good enough to get me through most of the ejb stuff, I think. Maybe once I'm a little more comfortable with the app (and J2EE in general) I might go a little deeper into cleaning that part up the way you mentioned Peter. I appreciate it though.
My other problem is in the web section of the J2EE app, let me know if this is veering towards another forum now.
There are a lot of complete files that are not used at all(jsp, js, css, html, xml, etc.) by my application. Many of them are from third party things added in (grid controls, calendar controls, etc), you know there are documentation folders, example folders and then just files that are for different skins and who knows what else. There are also multiple jsp pages that I believe have been replaced by other jsp pages, but the originals haven't been removed. I want to make sure I don't mistakenly remove a needed one though.
I'll apologize now because I've tried looking around and am just not familiar enough with J2EE and Eclipse to know if there is a simple solution for this. Thanks.
"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
|
|
|
|
|
My best wishes go with you. This looks like another example of
inherited project == can of worms and we all know that once you open a can of worms, you're going to need a larger can...
Did a quick google for the quote, but couldn't find it.
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
That is part of what I'm after. Thank you for that!
"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
|
|
|
|
|
I need to include the web cam image in gui through applet.I finished capture the image in applet.It works perfectly.But when I include the applet into the gui,applet is crashed.
The crash report file is appeared.The error is java.lang.securityException.Please help me.
|
|
|
|
|
1. Go and look at Google for possible causes of SecurityException[^].
2. Look at your code and check what you are doing when the exception occurs.
3. If you are not catch ing the exception then do so.
The best things in life are not things.
|
|
|
|