JOGL and Snow leopard - java

I'm having some major issues with getting JOGL to work on snow leopard.
I've installed all the necessary JOGL jars in
/system/library/java/extensions
I can get sample code to compile but when I attempt to run it it throws the error following error on trying to actually display the window.
Exception in thread "main" java.lang.RuntimeException: Unable to initialize JAWT
at com.sun.nativewindow.impl.jawt.JAWT$1.run(JAWT.java:100)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.nativewindow.impl.jawt.JAWT.getJAWT(JAWT.java:95)
at com.sun.nativewindow.impl.jawt.macosx.MacOSXJAWTWindow.lockSurface(MacOSXJAWTWindow.java:65)
at com.sun.opengl.impl.GLDrawableImpl.lockSurface(GLDrawableImpl.java:144)
at com.sun.opengl.impl.macosx.cgl.MacOSXCGLDrawable.setRealizedImpl(MacOSXCGLDrawable.java:87)
at com.sun.opengl.impl.GLDrawableImpl.setRealized(GLDrawableImpl.java:120)
at javax.media.opengl.awt.GLCanvas.addNotify(GLCanvas.java:413)
at java.awt.Container.addNotify(Container.java:2622)
at java.awt.Window.addNotify(Window.java:662)
at java.awt.Frame.addNotify(Frame.java:470)
at java.awt.Window.show(Window.java:858)
at java.awt.Component.show(Component.java:1563)
at java.awt.Component.setVisible(Component.java:1515)
at java.awt.Window.setVisible(Window.java:841)
at SimpleJOGL.main(SimpleJOGL.java:45)
Has anyone seen this error before and if they have how did you fix it?
Regards
James
EDIT: This error appears using both Java 1.5 and Java 1.6 and I've tried JOGL beta 5, beta 10 and the nightly builds

What build of JOGL are you using, and what version of Java (1.5 or 1.6)? There was some talk of the beta 5 release having this issue. I found this link. It's a shot in the dark but without more information it's all I have.
JOGL Kenai Link
I was able to download a version of JOGL from the following link
JOGL JSR 231 Beta 10
I downloaded the mac universal zip and was able to get it working by putting the jars on the classpath and pointing the java.library.path to the the directory I unzipped the archive to. The archive includes all of the .so files you need to get JOGL running. I don't think you need all of the jars included here. There seem to be a lot of files related to the CDC, which I think is a mobile platform if memory serves. I didn't include these in my test.
I didn't get the error you mentioned and am running Snow Leopard on a Core Duo MacBook Pro. The used the source from the Gears demo and it ran without a hitch. I even switched out the Frame with a JFrame to see if that would change anything. It worked fine both ways. You may want to try with this library and see if that works for you.

Related

JavaFx won't download on my MacBook Pro for Eclipse Oxygen

I have an assignment for my school that I have to submit that needs you to create a Java application that involves recursion, file read, and javaFx. I have a 15 inch MacBook Pro with an i7 processor. When I try to use JavaFx in a class in Java, I always get errors saying that javaFx.application.Application or javaFx.scene.Scene cannot be applied to a type. Basically, my Java oxygen application cannot run javaFx. I've tried multiple YouTube videos on how to download plugins from oracle and the Java oxygen marketplace. I told my instructor and he hasn't gotten back to me yet. Everytime I download a possible plugin like e(fx)clipse/2.0.0/ (or something like that), Java oxygen sends a message that it cannot complete the operation because new software has already been installed. I kept searching oracle for the latest JDK but javaFx still won't download. I was just wondering if it had to do with me having an Apple and not Windows computer or is there something else I can try. Thanks for your help!
Just go here and download the Mac version of the JDK and install it.
http://www.oracle.com/technetwork/java/javase/downloads/jdk10-downloads-4416644.html
That is all which is technically needed to run a JavaFX application. You should also download and install the latest version of Eclipse (Photon) because it fixes some problems with the latest Java.
http://www.eclipse.org/downloads/index-developer.php
If you like you can also install e(fx)clipse from the marketplace but it is not needed to write JavaFX applications.

Java 9 and JavaFX on Fedora 27 "runtime components are missing"

I work on java project in eclipse using javafx and java-9 but i got an error:
Error: JavaFX runtime components are missing, and are required to run this application
I have installed:
java-9-openjdk.x86_64
java-9-openjdk-devel-9.0.4.11-4.fc27.x86_64
openjfx-8.0.152-12.b04.fc27.x86_64
openjfx-devel-8.0.152-12.b04.fc27.x86_64
I tried removing and installing these libs again using yum and also from .rpm packages but it didn't solve that problem.
In eclipse I specified build path in project like on screen here:
Eclipse Build Path
I tried to fix it by adding external jars: ant-java.jar, javafx-mx.jar, packager.jar but this didn't solve the issue.
My version of eclipse is Eclipse Oxygen.2 Release (4.7.2) and i got e(fx)clipse 3.0.0 . My kernel is: Linux 4.15.9-300.fc27.x86_64 I have no problem on Win 10 but i really want to work on my Fedora. I spent huge amount of time but I didn't find the solution.
I am not a Linux user but I wonder how java-9... and openjfx-8... are supposed to go together. They are just incompatible versions. You will have to find a Java distro which already contains JavaFX like the Oracle JDKs.
Update:
You find the latest version including JavaFX here:
http://www.oracle.com/technetwork/java/javase/downloads/jdk10-downloads-4416644.html

xamarin droid project doesn't build after move to x64 java jdk

I have an xamarin android project. It worked and built so far. Now I changed the jdk1.8 from the x86 to the x64 since the Xamarin Forms designer needs this version to work properly according to Xamarin. Now I get this error on build:
5>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1965,3): error MSB6006: "java.exe" exited with code 2.
I read that this might be related to newer support libraries of google. But i have the newest version and had it already before I made the change. I also tried reboot my pc, clean and rebuild and delete all bin and obj folders without success. And so far I haven't found more information what this error could be and how to solve it besides switch back to the x86 version of the jdk.
I found the issue, while getting the diagnostic build log. I added the xamarin forms nuget package for embedded forms. With that package, the references exceed the max of what android is able to handle. So I had to enable multi-dex first. Then it built again.

How to run Java3D on RPi 2

I recently got a Raspberry Pi 2 and have been trying to get a program using Java/Java 3D that I've used before on the previous Model B to run on it.
The Pi is running Raspbian, and I've installed the libjava3d-java and libjava3d-jni packages.
I've copied the following files into a lib folder:
j3dcore.jar
j3dutils.jar
vecmath.jar
libj3dcore-ogl.so
I've then included -Djava.library.path="lib/*" in the command I use to run my program, but I'm getting an UnsatisfiedLinkError: no J3D in java.library.path
Could there be any other files that I need? Might I have an incorrect version of the native libraries? All the files I've put in the lib folder are ones that I've found in the system as installed by the package manager.
Thanks for reading
I assume that you're trying to install an obsolete version of Java3D (1.5.2 or earlier). Please follow these instructions to download and install Java3D 1.6.0.
Java3D uses the fixed pipeline, it is designed to use OpenGL whereas the Raspberry Pi supports OpenGL ES. Java3D 1.6.0 uses mostly the same public API than Java3D 1.5.2 and we have done no change to make it work with OpenGL ES. It has a very few chances to work as is on your device.
Rather use JMonkeyEngine 3, LibGDX or JogAmp's Ardor3D Continuation with its JOGL renderer. The two first ones work with the Raspberry Pi for sure, the last one still needs some work.
Edit.: You have a chance to make it work with Eric Anholt's driver, it already works with Processing 3 on a Raspberry Pi 2: http://labb.zafena.se/?p=972

Java missing pixels in gui?

I had to reinstall Windows and installed a fresh copy of Netbeans with the latest JDK.
I am experiencing an issue of missing pixels in Java application GUI's, see attached pictures. I even tried running it in a virtual machine. I also tried compiling jars with JDK 1.7 and reinstalling the latest Java.
Obviously, this bug appears only in my computer as I asked a friend to run my jar and he did not notice any missing pixels. These missing pixels appear in every jar I run.
Screen in fresh Windows installation virtual machine:

Categories

Resources