Java Bug/Virus

Community Forums/General Help/Java Bug/Virus

En929(Posted 2013) [#1]
Maybe I'm a bit behind, but I heard on the news that there has been a Java bug/virus going around and they said that one should uninstall Java? I was wondering what does the bug/virus do? I've been using Java to make my games quite a lot these days so thus, I was wondering more about the bug/virus.


big10p(Posted 2013) [#2]
Funny, I just had to re-install Java. It was stuck on an old version and wouldn't upgrade. Not sure if it has anything to do with the reported Java problems, recently. All seems working fine now, though.


En929(Posted 2013) [#3]
big10p, the same thing has happened with Java on my computer too. At first, I was thinking that there was something wrong with my computer or something inside my computer's configurations or so, wouldn't allow Java to upgrade.


SLotman(Posted 2013) [#4]
This is what's wrong with Java: http://www.npr.org/blogs/thetwo-way/2013/01/14/169338707/java-security-flaw-is-repaired-experts-still-recommend-disabling-it

Just disable Java from your browser and you should be safe.


En929(Posted 2013) [#5]
Oh ok thanks for the link. That's kind of scary because that's usually the way I make my games. I've been making browser games these days. I sure hope that this bug doesn't make people more afraid to download and-or use Java since that has been my primary language for making games these days. But, I guess with time this thing will blow over hopefully.


ima747(Posted 2013) [#6]
People have been more and more afraid of java, and rightly so. It has always been a massive source of security vulnerabilities and stability problems on all platforms, and it's too big to fix so it will always be a problem. When they do fix things they often do it fairly ham-fistedly and end up disabling older tech breaking backwards compatibility (often because they have no choice because they're patching a major security flaw that should have never existed in the first place), or they open up new problems.

Security problems, debugging headaches and bloated virtual machines aside, java has been surpassed for web development by any number of things, most notably now HTML5. I would suggest looking into Monkey if you're not interested in taking on any specific tech directly.

Personally I think if it weren't for Android then Java would be almost gone by now. There's better ways to do basically everything java does these days on almost every platform, web being the first platform to start actively dumping Java.

(Note for anyone that still might not know: Java and JavaScript are totally different languages, not synonyms)


Yasha(Posted 2013) [#7]
There's better ways to do basically everything java does these days on almost every platform, web being the first platform to start actively dumping Java.


As you said, on the Web there's JavaScript which is a much better fit for the task at hand.

On the desktop, there's this: http://www.ikvm.net/

The very thought makes me laugh. The real surprise though is that some people have found it's actually faster than the real thing - .NET must really be leaps and bounds ahead with its JIT technology if that's true.

I was going to comment something to the effect of "there are other JVMs", but... There really aren't that many! Most projects seem to have petered out and died. I guess Android really is the main source of demand for it these days.


ima747(Posted 2013) [#8]
.NET only runs in windows so it's JIT can be HIGHLY optimized on levels that typical java cannot. The exception being Android since it's a single OS (like .net and windows) and since the whole OS is based around java on limited resources hardware they've done some insane amounts of optimization and it runs SHOCKINGLY well... comparable to native code in many ways which is mind blowing. Comparable, but never ever ever better... and sometimes WAY worse. It's an amazing and impressive implementation of something that should never have been implemented. Why run 3 layers of abstraction ALL the time on something with very limited resources? Code simplicity... yet the code is just as, if not more complex than iOS code due to the threading implementations in Android... it's just slavish devotion to a web standard language, there is no logical reasoning for it. end_rant;

And on that note: google is trying to come up with their own alternatives to java now (see Gopher for one) with the same rough goals that java used to have before it ran amok.


D4NM4N(Posted 2013) [#9]
The exception being Android since it's a single OS (like .net and windows) and since the whole OS is based around java
wow..... You need to re-read on android.
Sure Java is a big part of the android eco system, but it does not -revolve- around it. Also, a lot of the high performance stuff is native ARM native.

.NET only runs in windows so it's JIT can be HIGHLY optimized on levels that typical java cannot.
What do you mean by typical? and also which implementation of .net are you talking about? MS's, Mono's?
(hence my point)


ima747(Posted 2013) [#10]
Well since anything compiled still needs to be wrapped in Java, ergo you cannot create a distributable Android app without *some* java (similar to how you can't create an iOS app without some Objective C), and that they didn't have compiled code as an option until I think 2.0? and that even now there aren't full interconnects from C/C++ to the UI layers which are java, which is why they're inherently less performant than iOS's interface (due to thread priority which is restricted by the java runtime)... just the number of times I used the word java in that last run on sentence kinda indicates how intertwined java is with Android...

Android is pretty much synonymous with Java from a development perspective. Yes there's ways around it (like you can get around Objective C on iOS), but that means you're working around using java which is what it's really all about. The SDK is a Java IDE, written in java, for writing Java, with all the code in java... you have to go out of your way to install the NDK (notice it's not the SDK, it's a new weird term they made up) and native code can't be written, compiled, or debugged with the SDK, you need to install other tools. Further, in Google's own description of the NDK they try to dissuade you from using:
"Before downloading the NDK, you should understand that the NDK will not benefit most apps." emphasis is *theirs* not mine...


ima747(Posted 2013) [#11]
was referring to MS's, as Mono is a copy of that (better IMO, but still not the origin). You would think that the OS manufacturer making tools for their OS to make code for their OS (and *only* their OS) would be able to find some neat tricks to optimize it. Granted it's MS so they could screw up anything, but I was always under the impression that their level of focus on .net made it more than total garbage. Not java or anything else *is* total garbage there, just referring to .net not being as bad as it could be if the people who wrote it didn't know as much as they (hopefully) did.

Regarding my statement of "typical" java, I was referring to your average java app on a normal platform, i.e. a universal java app that runs on windows, mac, and linux through the Oracle Java runtime that typically everyone has installed. Basically anything that doesn't have an opportunity to be highly optimized for a particular platform (hardware or software) as it's generic code (for portability) on a generic platform (for compatibility).

Personally I hate anything JIT. I like my code as low level as possible while still making sense in my head, and with as little overhead as possible, so I'm openly prejudiced against anything where I need a middle man in the form of a JIT compiler, or whatever else.


Yasha(Posted 2013) [#12]
.NET only runs in windows so it's JIT can be HIGHLY optimized on levels that typical java cannot.


This is kinda an excuse... but Sun was and Oracle is a multi-billion-dollar company: I'd really expect them to put as much work into optimising their Windows backend as Microsoft do, especially when it's the core technology of their business. The fact that Java can run on many platforms doesn't mean the Windows version needs to share all of its backend technology: Java is portable at the frontend, not the back.

Anyway this thread reminded me about IKVM so I tried it out and... it works. Perfectly. I have now got rid of Java entirely on my Windows install (yes yes reservations about .NET apply, but since .NET is pretty much mandatory if you're already using Windows for anything, it's not a strong objection and now I have only one bug-ridden JIT layer instead of two). 'Course I barely use Java for anything - basically Eclipse and that's it - so it's a risk I can afford to take, YMMV.

Since Eclipse provide a standalone Java compiler, I no longer need to pollute my machine with Oracle products! Yay!


Also, thinking about portability, abstraction layers and so on, I discovered a technique recently that might interest you ima747 (interest - I doubt you'll like it). Take a look at Compiling Higher-Order Languages into Fully Tail-Recursive Portable C by Feeley et al., (similar technique as used by Petit Larceny and a few other compilers, but explained better). It allows one to use C as a portable compiler backend target while retaining the full expressive power of assembly (it doesn't provide such good performance - a naive compiler gets maybe 50% slowdown, although a good one that generates optimiser friendly code can approach 0%), but it's really interesting because C's portability - as long as you stick to ISO - means you get write-once-run-anywhere more or less for free. No futzing about with JITs or runtime systems or Cheney-on-the-MTA or even GNU Lightning (probably gets better performance than most of those too).

I'm very interested in taking advantage of this technique as I think it has a lot of unexplored potential (compiling to C has been done to death, but compiling to expressive assembly that happens to be written in C hasn't seen nearly enough research). For instance, it takes no effort at all to support C++-style table-based exception handling using this method, instead of relying on setjmp.


ima747(Posted 2013) [#13]
Thanks Yasha, will take a look.

My personal approach is as follows:
For multi-target, not speed critical things I favor tools that can cross compile (like bmax) to keep life simple until the project reaches the extent of what's reasonable with a universal dev tool and needs to be broken out per platform to keep growing reasonably (when you start implementing platform specific stuff, or something outside of the original language intent and it just makes more sense to do it cleanly from scratch again).

For anything speed critical, or non multi-platform I favor the "lead" language on the platform and try to keep things as portable design wise as possible. Objective C has very little in common with Java syntactically, but if you write it with the intent of later porting it you can make your structures quite easy to move (basically you just change your syntax and that's 90% of the work). It requires a little foresight to keep it from being a PITA but it's really not that hard. This ends up with generally the fastest, cleanest code (no crammed in patches to try to jury rig something since you're just writing for the platform) and means bringing on platform devs to a project is easy since the project is already native to that platform (no need to find a flash dev with iOS experience and a bit of Objective C knowledge specifically for example, just any iOS dev will do in a pinch).

For prototyping I take the path of least resistance, whatever seems like the quickest way to get the concept down works, and again I try to write it with the structural intent of porting later if I anticipate that will be needed.

I like things to be written in code that feels solid, will have consistent results, and as much as possible won't be affected by outside changes on a system (can't really work around someone changing their graphics driver, but what if they change their Java runtime, that's got even more potential to screw things up in theory anyway).

But this has gotten pretty far off topic... appologies to to En929.

To summarize my thoughts on the topic: I personally don't like Java for many many reasons, not least of which is that it's a chronic source of stability and security problems on all platforms. It's a diminishing web technology, and there are numerous alternatives for any given task which are likely to be better (identify alternatives on a task by task basis, there is no straight up replacement for java). It's still a valuable language to know since many businesses have very large server and/or front end systems built on java tech, and it is the primary development language for Android which is statistically the largest portion of mobile devices which is the hot thing for software development these days.