As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I need a standalone Java parser (program which "reads" .java source files and generates AST [ie objects representing the contents of source]).
There's https://code.google.com/p/javaparser/ but it supports only Java 1.5
I know how to run Eclipse Java parser in "standalone" mode, but this parser uses too many Eclipse JARs, is too complex, and uses EPL license, which is GPL-incompatible
other IDEs (IntelliJ, NetBeans, JDeveloper) and javac compiler also must have some Java parsers, but I can't find any documentation how to use them in "standalone" applications
Any help? Maybe somebody of You also tried to do some standalone Java parsing?
Our DMS Software Reengineering Toolkit has a full Java 1.7 parser. But a parser isn't enough, if you intend to anything serious; check out Life After Parsing. DMS has the support you need beyond that to process Java interestingly, such as , attribute grammars, symbol tables, transformation rules, etc, plus good documentation for all of that. DMS is designed to support the construction of custom langauge analysis tools. It isn't GPL-compatible, though.
JavaCC has a Java 1.5 grammar.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
Where can I download or view industry sample standard Java application source code for learn the coding standards and coding styles? Java EE or Spring based application would be better.
I would first recommend you to go through coding conventions by Java. You could then look at the standards that are following for its own API (Collections, ThreadLocal, java.util classes). src.zip located at $JAVA_HOME of the installation for accessing the sourcecode (IDEs should generally resolve it).
If you like to look at more, try other popular opensource frameworks like Spring, Hibernate and popular apache projects like lucene, camel etc
Also, it would be a nice practice to use findbugs and checkstyle to improve the quality of the code you write.
Hope this helps
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Interpreted languages are nice, I can write some quick, prototypical code (i.e. using an interactive shell) for the purpose of exploration before delving into production level code.
What is the best approach for this with Java? Currently I'm creating Maven projects with Eclipse, and exploring things in my test infrastructure using JUnit... but this is less then ideal.
You can also check out Eclipse's Scrapbook Page:
Menu>File>New>Other>(search for)Scrapbook Page
Why not use something like BeanShell ? It's a scripting solution for Java and offers a console-based interactive scripting environment.
Here's the quick start guide. Note that you can also start a BeanShell console from within Maven.
I've picked BeanShell here since it's the closest thing to Java, but interactive. You could pick another console-based JVM language such as Scala, Jython etc. They're more removed from standard Java since they're different languages, but still offer interoperability with your standard Java components.
You might want to try out JRebel for quick code tweaking. Or if you are into web development, check Play framework.
http://zeroturnaround.com/software/jrebel/
http://www.playframework.org/
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
CoffeeScript is so cool. If there is any language use the coffee syntax but running on jvm, like groovy, scala?
Python's syntax is not cool. i can't use so many xx,self in my code, that's ugly.
Yes. CoffeeScript compiles into plain old JavaScript, which can be executed by modern JVMs (v6+).
Incidentally, it's funny that you contrast the syntax of Python, since both languages depend on whitespace as syntax (which is a controversial topic!). Anyhoo, happy hacking!
[Edit] Here is a more useful introduction to using JavaScript on the JVM.
While it is not specifically Coffeescript, Mirah is a JVM language that compiles directly to JVM bytecode or Java source and requires no runtime library to run. Which makes it analogous to the way most people use Coffeescript. That is, avoiding the ugly semantic and syntactic elements of Javascript. Mirah is statically typed, yet its syntax borrows heavily from Ruby (Mirah is Javanese for Ruby).
While the language itself is still in its infancy, it's very possible to use it today. I've done most of my University homework using it where writing Java directly would have otherwise been required. I'm also poking at using it to develop for Android.
It does not look like Coffeescript, but it has the same goals and you may find it a good fit. Not to mention that Coffeescript syntax is also inspired somewhat on Ruby so the two share a common ancestor.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I've read this discussion on Stackoverflow, but it's been over two years since it was asked. I am a beginning Java programmer and have little knowledge of appreciated and widely-used libraries for this platform.
Of course I do use some libraries (JUnit, parts of Spring), but I'd love to have a list of libraries, that every Java developer should know (i.e. Hibernate, Velocity..?). I am interested in every field of Java applications.
What would you recommend for me (or any other beginner) to check out?
Here is a good list of Java libraries you should know about.
https://java-source.net/
Every beginner should spend more time learning core java. There are no all-around libraries. Most if not all libraries are problem/domain specific...
My oppinion...
Apache commons has many libraries (like copying a stream to another). In the Java EE web application area the Spring framework provided independent utility libraries (like file upload servlet filter and for dependency injection), that meanwhile becomes less important because of the simplifications in Java EE.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
How to get java file i.e source code from class file i.e from compiled file?
Check out this Java Decompiler.
Also see this Wikipedia page to know more about decompilation.
It should be noted that the code you get on decompilation of bytecode isn't very readable.
You have to use a disassembler.
Java Decompiler is a good choice.
Also Java Decompiler has a plug-in for Eclipse.
You can use javap command to get the overall structure of the file.
On the side note: Best way to disable anyone from getting the source from your compiled code is to use obfuscation.
You can make use of javap for getting the source back from bytecode.
There are plenty of tools and plugin that help you to disassemble and you can find some discussed here.
Yes you cannot do anything like reverse conversion.
What you can do is modify the bytecode at runtime. That's allowed in Java...
Check for java.lang.instrumentation package. That will help you to achieve your goal to some extent...
I just published a stand-alone Java Decompiler GUI (based on Jad) which you can get from Util Java Decompiler (JAD based) v1.0
This is a Windows based .NET 4.0 application, which supports the drag n'drop of *.jar files.