java freezes my computer and requires a hard reboot - java

I have been getting semi-frequent freezes when running Java apps through NetBeans 6.9.1. As soon as netbeans would finish compiling my app and then start to run it, my pc would freeze, i could still move my mouse and mp3s would still play in the background but i couldn't interact with anything on the screen at all, not even windows icons and the task bar. No ctrl+alt+delete, nothing. And if i kept clicking the mouse around 5 or so times trying to get the system to respond, my mouse would also stop responding.
For a while it seemed like cleaning and rebuilding through netbeans once per startup would fix the problem, but then it happened independent of this.
More importantly, i have got just today for the first time been able to reproduce the freeze by launching a java app outside of Netbeans, through a .bat file.
If anyone has any suggestions on resolving this issue i would much appreciate it.
When i reproduced the freeze outside of the ide i was running javaw and java's version info is:
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode
the problem is also independed of the java app i'm running.

Seriously, some Java-related system lockups are related to graphics acceleration driver issues. Try launching your Java app with 2D acceleration disabled.

Related

Eclipse RCP crashes on Ubuntu 16.04 with SIGABRT in gdk_display_open() when using Desktop.open(...)

We have recently made a cross-platform build for one of our Eclipse RCP applications. On Ubuntu 16.04, when the following code is executed:
Desktop.getDesktop().open(somePath.toFile())
It crashes with SIGABRT in gdk_display_open. I had used both Oracle's JVM and OpenJDK (JRE 8) to the same effect.
I thought, okay, let me try this first and disable the functionality if it isn't supported:
public static boolean isSupported()
{
return Desktop.isDesktopSupported() &&
Desktop.getDesktop().isSupported(Desktop.Action.OPEN);
}
That crashes in the exact same way. I cannot seem to even ascertain that Desktop is supported via code without the potential to cause a crash. The code I am using works fine otherwise in Windows and even Mac. Why might this happen and is there a workaround for it? Keep in mind this isn't a plain old Java exception that I can catch, this crashes in the JVM itself.

e(fx)clipse code completion isn't working

could you give me any advice how to fix that, please?
Recently I installed e(fx)clipse, but code completion when you type a dot, isn't working. Google didn't help.
Edit: Ctrl+Space works well, But dot with dropdown list of options is not working. (when you type a dot and see which methods can work with some instance)
Edit2: Also, when I type imports like:
import org.openqa.selenium.*; -----> autocompletion is not working here, even if I type that exactly under the line like that (in my old projects) - so it's not the issue of a project settings.
Installation details
Edit3: Content assist looks fine... but the issue still present.
Edit4: After doing this:
To clarify Alex's answer.
I had the same issue of being unable to get auto-complete with my JavaFX CSS. My fix was add the JavaFX SDK to the library list. To do that:
Go to Project | Properties
Select Java Build Path in the tree
Click on the Libraries tab
Click the Add Library... button
Choose JavaFX SDK
Click Next then Finish
Click Apply
Click OK
e(fx)clipse failed to start at all. (only splash screen appears for a milisecond)
Edit5: Java version is:
$ java -version
java version "1.8.0_71"
Java(TM) SE Runtime Environment (build 1.8.0_71-b15)
Java HotSpot(TM) Client VM (build 25.71-b15, mixed mode, sharing)
Edit6: Funny, but after I reinstalled e(fx)clipse, it still fails to start. The same issue with 1-millisecond splash screen and nothing more..
Edit7: Reinstalled JDK + several times reinstalled e(fx)clipse: 2 times version 4.5.2 and one time the version 4.6RC4a - - - in all the cases just 1-millisecond splash screen appears and nothing more... yep, and before these reinstallations I cleaned Windows registry.
Edit8: I just used Java Mission Control and recorded timeframe during which I tried to open e(fx)clipse, and I noticed this thing:
From Java Mission Control
Thanks in advance.

Android Studio IDE does not show dialogs' content on Ubuntu 15.04

Does anyone experienced and know how to fix this issue:
Android Studio sometimes (randomly) does not show any content in dialogs (find, commit, compare dialogs). It takes a part of screen which was visible in that area where dialogs appears. And content of dialog is not refreshed and not visible at all.
All functionality of that dialog works, just I can't see anything.
Here's how it looks like:
Anyone knows how to fix this?
I'm working on Ununtu 15.04 with Android Studio 1.2.1.1, which is based on IntelliJ IDEA.
Java version is 1.8:
vilius#vilnius:~$ java -version
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
vilius#vilnius:~$
STUDIO_JDK=/usr/lib/jvm/jdk1.8.0_60 add to /etc/environment
create new Launcher over old: Android Studio - Tools -CreateDesktopEntry
So apparently it's because I've done "Lock to Launcher" to keep Android Studio visible in Launcher all the time. It creates shortcut which then uses OpenJDK instead of Oracle Java.
That's when I'm getting this message:
OpenJDK shows intermittent performance and UI issues. We recommend
using the Oracle JRE/JDK.
In android-studio/bin/studio.sh file it's written, that $STUDIO_JDK environment variable is used to determine which java to use when launching Android Studio IDE.
To find which java is running for your Android Studio, you can check System Monitor:
Or Android Studio-> about also tells you which JVM is used:
The answer
Install Oracle Java. Create $STUDIO_JDK environment variable which directs to Oracle Java. Don't use Lock to Launcher functionality.
It's Ubuntu's bug, and solution is to just kill compiz. You can do it from command line or System monitor.
All running applications will be brought to 1st desktop, and you'll be able to continue your work.
Tried both Oracle and OpenJDK Java by setting STUDIO_JDK environment variable:
#export STUDIO_JDK=/usr/lib/jvm/java-8-oracle
export STUDIO_JDK=/usr/lib/jvm/java-7-openjdk-amd64
Still experiencing this issue sometimes. :/
Changing Settings->Appearance & Behavior->Appearance->UI Options->Theme does not help either.
Apparently, it's Ubuntu's bug:
https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/1072206
Bug Description
[ Impact ]
With nVidia hardware from time to time window content is rendered
black or transparent. The problem manifests more frequently as
session uptime increases.
Apparently the problem was caused by textures being cached and
not freed, resulting in memory exhaustion conditions. It turns out
the texture caching is unnecessary anyway.
[ Test Case ]
Verification requires an nVidia GPU with proprietary drivers.
The problem can not be reproduced at will, only after some
time (depending on resident GPU memory and usage) and even
then only randomly and unreliably.
[ Regression Potential ]
It is unlikely this change has the potential to introduce
new regressions.
[ Other Info ]
Fix was cherry-picked from the Ubuntu "Vivid Vervet" dev release
where it has been in use for some weeks without problem.

Java JAR runs fine through command line, but not by double-clicking JAR

Title is pretty self-explanatory I think. When I run the JAR, the following exceptions occurs:
So naturally I run it through the command prompt so hopefully the exception message and stack trace shows up but when I do that, it runs perfectly fine - everything works, no messages on the prompt (except for deliberate prints of course).
It's written in JDK 1.7.0_71 (64bit). I have JRE for that version, both 32 and 64-bit on my machine. I've force it with right-click->open with to use the javaw.exe from all three of them but each throws the same error. Putting java -version gets me:
java version "1.7.0_71"
Java (TM) SE Runtime Environment (build.1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
Windows 7 64-bit. NetBeans 8 (runs fine through NetBeans, no errors on output window). Program uses the GDAL, GeoTools, NetCDF, EJML, and JodaTime libraries.
I mean I'd provide more information but I'm not even sure where to start. Even just looking for advice on where to start just to learn what the problem is.
UPDATE: After just putting a message dialog in random lines until I could narrow down the issue, looks like the error is with the GDAL/OGR libraries. (The exact line is at org.gdal.ogr.RegisterAll()) The strange thing is why it works fine the other ways. At this point though I figure it's a GDAL specific question now as the GDAL bindings has been very weird and troublesome before.

Can't run my project in eclipse because java force closes

I hope this is more worded to be on topic because me not having the ability to code because of a java issue is off topic apparently.
When I try to run my project in eclipse. Eclipse just sais at the bottom with no stack trace. If I compile the jar file and run it with javaw it does nothing. If I run it with java it brings up the java(tm) platform has stopped working.
What I have tried:
Changing association of .jar to use java and javaw
tried uninstalling java and reinstalling
installing windows updates
restarting my computer
cleaned registry
running it in command prompt (just pulls up a window saying "Java(tm) platform se binary has stopped working." There is no stacktrace inside the prompt either.)
scanned for any malware/viruses
using the "fix and restore windows 8 option"
My system:
Windows 8 :/
java 7 latest 64 bit Update 13
java SE dev kit 7 Update 13 (was happening before I installed it)
16 gigs of ram
I can give you more info if need be.
Jars work on my other computer just fine.
edit: Still no luck. 8 out of 8 places I asked for help I got down voted. Looks like im not developing anymore.... Thanks.
Well, there is a known bug with this message, the workaround should be to disable d3d acceleration by adding this as a VM argument: -Dsun.java2d.d3d=false

Categories