Is GNU's Java Compiler (GCJ) dead? [closed] - java

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
As of October 2010, is GNU's Java compiler dead?
Are there any active alternatives (especially for compiling Java to native code)?
LLVM solutions would be preferred.

You could use IKVM and Mono's ahead of time compiler to generate native code.
EDIT
There is an example at the bottom of this page.

A more pertinent question would be whether it was ever really alive. Consider these issues, from its own website:
1.2 support is 'still incomplete'.
1.3 ditto.
The project was last updated over a year ago [as of October 2009].
Currently 'supports most of the 1.4 libraries plus some 1.5 additions.'
Doesn't support java.nio.
Doesn't support javax.naming ('complete but no providers').
Doesn't support javax.sql.
Doesn't support AWT or Swing.
Doesn't support localization via java.text.
State of java.security is 'unknown'.
Doesn't check permissions in java.lang.reflect.
Does it compile generics?
Huge chunks missing out of other packages, e.g. nearly 50% of java.util.
No annotations.
No script engine.
Nearly all of javax.xml.* (recursively) is missing.
No org.omg.CORBA.
Practically no org.w3c.
Current comparison with JDK 1.6 is here. Note that this appears to add percentages to give a completely meaningless total.
And note that it isn't billed as a 'Java compiler'. It is a compiler for a subset of Java known as GNU CLASSPATH. Which in turn hasn't been updated since Feb 2009.
If it isn't dead it is certainly lying down.
EDIT It's dead. GCJ is no longer listed as a GNU package. And after four years of zero activity we are entitled to assume the same about GNU CLASSPATH.

One alternative to compile Java to native is Excelsior JET.

I think not that it is dead. It has only few important. Which result in a slow development. There are 3 fact because it has only few important today:
It based on the GNU Classpath. Since Java is open source (OpenJDK) there is no large need for another open source Java. This has slow down the development speed.
The Java was faster in the last years. The GCJ output is not faster. In many cases it is slower.
The GNU Classpath has many incompatibility.

Related

Which is the java version that does not allow the malware to to automatically install from a webpage? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Improve this question
I have seen that if you have a 'new' version of java in your browser, then you are not in danger of having a malware capable of installing into your computer automatically from seeing a web page, by using a java ... flaw.
Can you please tell me which is the java 'safe' version, that does not allow the malware to automatically install on computer?
(I really need to know if I was exposed to infection yesterday... is java 6 a 'good' choice)
The thing is that I want to be sure that I am 'safe'.
I want to be sure that I am 'safe'
The only way to be sure you are safe from malware from Java exploits is to uninstall it completely. The best that can be said of the latest, most secure Java version is that it has no known security bugs.
Java has reached 1.7, so just about any 1.6 version should be considered unsafe.
the thing is that I have used yahoo and there seems to be a problem Malicious advertisements served via Yahoo
That page notes:
The investigation showed that the earliest signs of infection were at December 30, 2013. Other reports suggest it might have started even earlier.
Now let us look at Release Dates for Java 6. The last publicly available Java 6 version is:
Java SE 6 Update 45[76] 2013-04-16 42 security fixes;[77] other changes;[76] final public update[78]
Or April 16th, last year. Some 8 months before that security alert.
Like I have been saying. Every publicly available version of Java 6 should be considered suspect. Every - single - one.
You should run a Malware checker on your machine.
But your answers & comments indicate to me something more. You don't really need to run Java applets in the browser, and probably do not need it for any other reason, so also uninstall Java completely.
And I do mean uninstall it, I do not mean not disable it, I do not mean not keep it up to date. You do not seem to need it on your PC, so don't take the risk.
Java is actually one of the most secure languages since it has a built-in security manager that can be used to sandbox applications and does a lot of built-in array out of bounds checks to prevent things like buffer overruns.
However, there have been a lot of problems in recent years regarding the security in Java applets. These are Java programs that can be run from a webbrowser. Applets have an even stricter sandbox to prevent the applet (or the website) from accessing your filesystem etc but there have been bugs found that can allow malicious code to escape the sandbox. These bugs are patched as quickly as possible so it is important to update Java (and keep up to date) on a regular basis.
If you don't need to run applets in your browser, the best thing to do to avoid these problems is to disable applets in your browser. This link can be used to learn how to disable applets in your browser of choice

What JVM assemblers are there? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I want a JVM assembler that is straightforward and simple. It should take a text file written in the mnemonic language described in The Java Virtual Machine Specification and produce class files, i.e. bytecode.
To be clear: I don't want a library that can generate class files from invocations of an API.
What are the current statuses of the JVM assemblers? Do they support invokedynamic (not mandatory to me, but an advantage)? On what operative system can I use them? What are their individual pros and cons?
Some time has passed, and now there is an alternative to Jasmin called Krakatau.
From the README.txt:
The Krakatau assembler is intended as a replacement for Jasmin, and was originally written due to the limitations of Jasmin. It is mostly backwards compatible with Jasmin's syntax, though not necessarily with the extensions introduced in JasminXT. However, Krakatau offers many new features, most importantly the ability to directly specify constant pool references.
At this time, it seems that Krakatau was last updated a month ago, and Jasmin was last updated nine years ago.
Krakatau does support invokedynamic and utilizes the same instruction names as are used in the JVMS.
Krakatau is implemented in Python. Personally, I like my Java tools to be implemented in Java, but given the nature of this tool (constructing class files from non-Java source) and the lack of competition in this niche, I'll give it a chance.
Jasmin is the de facto standard. Recent versions support invokedynamic. It's written in Java, so it's portable.

Tools to detect duplicated code (Java) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I am in a project where previous programmers have been copy-pasting codes all over the place. These codes are actually identical (or very similar) and they could have been refactored into one.
I have spent countless hours refactoring these codes manually but I think there must be a better way. Some are very trivial static methods that could have been moved into an ancestor class (but instead was copy pasted all over by previous junior programmers).
Is there a code analysis tool that can detect this and provide reports/recommendations? I prefer free/open source tool if possible.
I use the following tools:
PMD/CPD (BSD-style License).
Checkstyle (LGPL License) - support was removed, see details.
Both tools have code duplication detection support. But both of them lack the ability to advise you how to refactor your code.
JetBrains IntelliJ IDEA Ultimate has good static code analysis with code duplication support, but it is not free.
Most of the tools listed on the Wikipedia article on Duplicate Code Tools will detect duplicates in many different languages, including Java.
SonarQube can detect duplicated codes but does not give recommendation on eliminating them. It is free and - although with the default setup it can only detect lexically identical clones
Either Simian or PMD's CPD. The former supports a wider set of languages but is non free for commercial projects.
http://checkstyle.sourceforge.net/ has support for finding duplicates
See our SD Java CloneDR, a tool for detecting exact and near-miss duplicate code in large Java systems.
The CloneDR will find code clones in spite of whitespace changes, line breaks, comment insertions deletions, modification of constants or identifiers, and in a number of cases, even replacement of one statement by another or a block of statements.
It shows where each set of clones is found, each individual clone, an abstraction of the clones having their shared commonality and parameterization of the abstraction to show how each clone instance can be derived from the abstraction.
It finds 10-20% clones in most Java systems.

Java obfuscators [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm looking for a good Java obfuscator.
I've done initial research into the following Java obfuscators: proguard, yguard, retroguard, dasho, allatori, jshrink, smokescreen, jobfuscate, marvin, jbco, jode, javaguard, jarg, joga, cafebabe, donquixote, mwobfu, bbmug, zelix klassmaster, sandmark, jcloak, thicket, blufuscator, and java code protector.
I tried proguard and it has a really nice GUI, seems really stable, and seems to be the most popular, but it seemed to not like some enumeration on a referenced jar file (not within the code I was trying to obfuscate) which was weird. Yguard seems to require some interaction with ant, which I didn't know too much about.
What is a good java obfuscator? It doesn't need to be free, it just needs to work well and be easy to use.
I use ProGuard heavily for all my release builds and I have found it is excellent. I can't recommend it enough!
I have encountered obscure bugs caused by it's optimizations on several occasions and I now disable optimizations across the board - haven't had a problem caused by ProGuard since. Though, to be fair, these were all quite some versions ago - YMMV.
I used to use the GUI only to get a config started, and then I resort to editing the text config myself, which is really very simple to do. These days I do the config by hand.
I have quite complex projects all of which involve dynamic loading and reflection. I also heavily use reflection for a callback implementation. ProGuard has coped with these very well.
EDIT: We also use DashO Pro for one of our products - I looked into it for packaging the products I am responsible for and concluded that it's configuration was too convoluted and complex; also integrating it into the build script seemed like a bit of a pain. But again, to be fair, this was circa 2001... so it might be better in current versions.
A good collection of links to free and commercial tools is given in this arcticle
"Protect Your Java Code - Through Obfuscators And Beyond"
The author also discusses the strong and weak points of bytecode obfuscation
What is the issue with ProGuard ? (which is recommended both by this question and this one).
There is a section of troubleshooting about enumerator, but they seem to be taken into account just fine.
However, Obfuscation breaks some attempts at reflection, even though modern obfuscators can detect and to some extend adjust usages of reflection in the code they're obfuscating.
I used Zelix Klassmaster in a commercial application for several years and found it to be excellent. I threw quite a few resources at the obfuscated code, and was not able to "break" it. It's pricey, but good.
I only stopped using it when my version got old enough that the upgrade cost was significant. My needs had changed and I didn't really need to obfuscate the classes anymore. However, if the need arises again, I'd pay for it and use it in a flash.
Cheers,
-Richard
We are using Zelix Klassmaster for couple years and I can recommend it.
I use and suggest Zelix - 100% - very solid and robust protection

Tools for converting non-Java into Java source [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Are there any good tools out there for automatically converting non-Java source code into Java source?
I'm not expecting something perfect, just to get the worst of the grunt work out of the way.
I guess there is a sliding scale of difficulty. C# should be relatively easy (so long as you ignore all the libraries). (well written) C++ not so bad. C requires making a little OO. (Statically type) functional languages may be easy to grok. Dynamic OO languages may require non-local analysis.
One thing you can try is find a Java bytecode compiler for the language you're talking about (there are JVM compilers for all kinds of languages) and then decompile the bytecode back into Java using a decompiler like Jad.
This is fraught with peril. The regenerated code will suck and will probably be unreadable.
Source-to-source migrations fall under the umbrella of Program Transformation. Program-Transformation.org tracks a bunch of tools that are useful for language recognition, analysis, and transformation. Here are few that are capable of source-to-source migrations:
ASF+SDF Meta-Environment - As noted, there is no new development on this tool. Instead, the developers are focusing on Rascal.
Rascal Meta Programming Language
Stratego /XT
TXL
DMSĀ® Software Reengineering Toolkit (commercial)
If you spend any time with one of the open source tools, you'll notice that even though they include source-to-source migration as a feature, it's hard to find working examples. I imagine this is because there's no such thing as a one-size-fits-all migration. Each project/team makes unique use of a language and can vary by libraries used, type complexity, idioms, style, etc. It makes sense to define some transformations per migration. This means a project must reach some critical mass before automatic migration is worth the effort.
A few related documents:
An introduction to Rascal - includes a migration between the toy language Pico and Assembly starting at page 94.
Cracking the 500 Language Problem
An Experiment in Automatic Conversion of Legacy Java Programs to C# (gated) - uses TXL
Google: ANTLR
The language conversion is fairly simple, but you will find the libraries are different.
This is likely to be most of your work.
If you just want to use some legacy C/Pascal code, you could also use JNI to call it from Java.
If you want to run it in a Java applet or similar constrained environment, and it does not have to be very efficient, you can use NestedVM (which is a MIPS to Java bytecode converter) in conjunction with a gcc cross-compiler that compiles to MIPS). But don't expect to get readably Java code from that.
Any of those tools might help only if your non java code is not huge enough.
If its huge non java code and if you want to seriously translate it to java, then few things need to be thought of, its not just hundreds of lines of code, there is a design beneath it, there are few decisions taken by people beneath the code due to which certain problems might have been solved and few things have been working there. and investing time on any good translator won't be worth as it won't exist, it's not just syntax translation from one language to another.
If its not so huge code, its better to re write in java, as it has so many APIs packages out of box, it might not be big deal, hiring few interns for this also might help.
ADA to Java can be done with a find-and-replace!

Categories

Resources