Java, especially the java compiler (javac), isn't working (10% of the time it works, wtf? ).

Hi, installed Java before on my vps and haven't noticed problems. But now the compiler and java itself are horribly inconsistent. The Java compiler hangs up and gets stuck, sometimes in -verbose mode it says "something about parsing" and then nothing. Sometimes Ctrl+C gets me out of it, most of the time I need to open another shell and kill -9 the process.

I mean a simple program like HelloWorld. I've installed at least 6 "different" java versiona and reinstalled my VPS 3 times with CentOS 5, Debian and Ubuntu ( 32bit all, VPS cpu is 32bit as well ). What the hell is wrong? Could it be the hardware my VPS uses??

This is basically what I've been trying to compile. Sometimes the compilation works and running with Java prints out the message.

Linode is way too expensive for me. I'm not running a business. Currently I pay 10€ for a whole year (100GB Transfer/month, 5GB storage, 256RAM) for my root accessed VPS - it's all I need. Only recently did Java start to fail

Afaik linode doesn't provide a similarly priced service.

How can the compiler just NOT work anyway? wtf? Can a hardware upgrade really destroy java like this?

No really it's actually been really awesome. The control panel works flawlessly, lots of distros to choose from. All that kind of jazz. Worked fine for 5 months. It's Swedish so dunno if that matters:P http://www.oderland.se/

But alas... Java is broken! O.O - more importantly, why ? Is it really new hardware that could be the cause?

Well. The point remains, why isn't the java compiler working? It's worked before, there's no restrictions, sometimes it gives errors, mostly it just does nothing, very rarely it actually manages to compile.

I FileZillaed the error log that the compiler spat out once (When compiling a helloworld program), maybe a glance would enlighten any of you towards an explanation?

With the help of a wonderful sir at their support we upgraded my account to a premium one to test if that would fix the problem, it didn't. :/

No idea what to tell you there, but if it compiles fine elsewhere, then there's some environment issue, either with your VPS's hardware or the hypervisor. Looks like they're using OpenVZ, which frankly I don't have a high opinion of. Linode and AWS use Xen, and I've never had a problem with that.

Currently I pay 10€ for a whole year (100GB Transfer/month, 5GB storage, 256RAM) for my root accessed VPS

For price like that I'm surprised anything at all works there. Actually, I could not find a shared host for that price Anyway, the cause being the problem with the quality of the hardware/setup is highly possible.

I tried first installing GCJ wich is like an open source gnu java compiler. When running that it gave me an error relating to gcc. And so I updated my gcc "yum install gcc"/"apt-get isntall gcc" and tried again, still, gcj didn't funciton - gcj gives the following error:

However, now that I tried again with the standard java compiler "javac" it worked fine. I was surprised, i tried again, and again.. and again. It worked every time.

Which is curious since I've always updated and upgraded the distro after reach reinstall. So, to be 100% sure, I'm going to reinstall the VPS to CentOS 5, upgrade, install jdk1.6.0_31, try it and expect problem, then I'm going to seperately udpate gcc and see if that solves the problem.

I tried and the errors still kept coming, but when I installed gcj, the standard java compiler "javac" started to work - gcj doesn't work, but it probably came with some sort of dependencies that made the java compiler work...

Sigh, so confusing... well, it seems to work now anyway - though I've no idea why.

When I install gcj it also installed java and javac into a /etc/alternatives folder. And it automatically also creates symbolic links in /usr/bin overriding the symbolic links I've made myself when I installed java from oracle. So what happens is that the compiler I use is the one gcj brought with it, not the standard one oracle provides. So! With gcj installed I recreated my symbolic links to link to the standard java compiler (instead of the one located in /etc/alternatives) and I still got the same errors.

So nothing changed, the errors are still there.

I'm going to try install java 7 instead of 6.31 and see how that works.

[EDIT]Nope, same problems with the jdk7. Maybe I'm just installing it wrong since I'm the only one with the problem :L

[EDIT]I've been trying to figure it out all day long and most of yesterday as well. Standard oracle java doesn't work and neither does openjdk nor icedTea.

With a "apt-get install gcj" a "java" and "javac" file are installed into /etc/alternatives and slinked in /usr/bin/. They work. And so I'm using them.

GCJ is garbage; its statically compiled code is slower than hotspot. Good startup times though. One of the more annoying things about managing a Debian machine is making sure gcj never gets onto a machine, since it always tries to sneak in through dependency resolution. It's probably some simple priorities setting that'll prevent it, but my apt-fu isn't what it should be.

Still wouldn't explain the random crashes except for wonky underlying platform like a broken hypervisor. But then again that's pretty much the description of OpenVZ.

Hmm. I understand you guys have a working java copy on your vps? Do you get/update it through a specific repo with a package manager? Since I can't get it to work manually at least and the only repo's I know of give me openjdk.

Everything java-related I install by hand, including java itself. Once I have java, ant, and maven, there's little else left for me to install that those tools don't automatically fetch for me. My VPS runs fedora, so I download and install the RPM by hand, and at work where we run RHEL and CentOS, I just drop it in our local yum repo and update.

Just a quick update. My VPS provider still has issues with the java compiler. Java programs seem to run fine though, but the compiler works 20% of the time, 50% it hangs (kill -9 to the rescue ._.) and 30% it spits an error.

I tried the budget VPS at http://123systems.net/vps.html for a month (3$/month) and their services worked flawlessly and their customer support for lowly me was amazing (The customer support for my current VPS provider is also good, but they just can't figure out what's wrong with their servers - they keep me updated though). The compiler and the java program worked like a dream. All in all, I highly recommend their services and I will probably be switching over once my current contract runs out. So I suppose it all boils down to the service provider and nothing else.

I suppose you get what you pay for, but at my current provider not even the high quality servers could run the compiler correctly. So I don't think money is the issue here.

I don't know what I exptected, I guess I hoped they'd find a fix. They gave me free upgrades to try but the javac didn't work on them either. I just wanted to clarify that money had nothing to do with it as was earlier in this thread suggested, 123systems similar budget VPS worked just fine.

It might have been worth you actually having a more thorough look at the problem, because I suspect it had nothing to do with the VPS. javac is, all said and done, a very straightforward piece of software.

Nope. All the different java compilers I tried were all fine. I wasn't the only one having the problem either, they couldn't get it to work at their servers either.

I truthfully have no idea why it didn't work. The most puzzling aspect was that sometimes it worked, sometimes it locked up, and sometimes crashed with an error compiling a hello world program. You can't explain that.

I used the same methods to install java on the 123systems VPS and they worked fine.

I will not have you bully me into trying to figure out why it's not working, I've suffered enough!:P It just doesn't - THE END!

I think I mentioned a long ways back that your provider was running OpenVZ, which is known to have problems with Java and any other memory-hungry app. Depending on how it's configured, OpenVZ can be made to more or less lie about how much memory is available, giving it to you initially then taking it away if any other virtualized domain demands it.

I might have had a more little confidence than the others in the more expensive tier, assuming it might be Xen instead, which cannot pull these shenanigans. Of course I would have actually checked out the specs before cracking open my wallet...

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org