NetBeans Java OpenGL Library not being found - java

I'm trying to setup Java OpenGL in NetBeans. I have the library imported, and the ones that I'm trying to include in the file are located at:
HelloWorldJOGL > Libraries > JOGL - jogl-java-src.zip > javax.media.opengl >
All of the libraries being included are there (I can search through them and open them in the project tree in NetBeans), but NetBeans is saying it can't find it. I'm not sure how to tell it specifically to look in the Libraries folder, which seems redundant to me, anyway.
The program files are located at:
HelloWorldJOGL > Source Packages > helloworldjogl > HelloWorldJOGL.class
HelloWorldJOGL > Source Packages > helloworldjogl > HelloWorldJOGL.java
I'm not sure how to let it know the libraries are included, like I included them. Again, to me it seems like it's being really stupid, but I really would like to solve it.
The specific error is called, "package javax.media.opengl does not exist."

It's really easy, just go to projects Tab and then in your project right click on Libraries and click on either Add Library or you can click on Add JAR/Folder.
I think this will resolve your problem.

Netbeans allow us to install plugins, these can be really helpful some time,
like here for using OpenGL here is a plugin for it.
And if you want to know how to install plugins, it's very simple,
Steps for installing plugin,
Goto 'Tools' menu tab
click on 'Plugins'
Goto 'Downloaded' Tab
Click on 'Add Plugins'
Browse for the actual jar file of the plugin, or select all NBM files from the zip file you downloaded
Click on 'Install'

You have to extract the zip archive into a folder! If that doesn't work then you may need the natives for your OS.

Related

Need LWJGL Setup Guide For Eclipse

Every time I look online the download is not in the same format as the current version, which leads to following the instructions and not being able to use the libraries I need. I'm new to lwjgl but fluent in java if someone could help me set up lwjgl I would be every appreciative. More specifically, the download is not broken up into folders like many that I see in tutorials.
rightclick on Project > Properties > Java Build Path > add exterlnal jars...
Now navigate to the downloaded and extracted LWJGL-Folder and select all .jar files inside. And press Add and then Apply. Now it should work fine.

What is the "right" way to add libraries on Netbeans?

I'm a using Netbeans 8.1 to code in Java, when I want to add an external library (such as XStream, JDateChooser, etc) I find the .jar online and I add it to my project through the right clicking in Libraries --> add JAR/Folder.
After this I write my code and everything works fine until I finish my project and I want to export it into a .jar with Clean and Build
I think this maybe because I give an absolute path to the libaray instead of a relative one but I'm not sure.
PS: The library that I'm having trouble with is XStream 1.4.7
All the libraries included should pack in a jar file after build. The simplest approach is to click right on your project, select Properties and The project properties. In the new window opened find Categories and Libraries. The in the right side you may see the button Add library/JAR. Probably it's the same way.
Also you can create a Maven project and import all the libraries through dependencies.

Box2dLights on libGDX android project

I tried to import the jars of Box2dLights to my project in libgdx, I configure the Buildpath and errors always happen.
Where I need to put the jars? Someone know please?
thanks : )
Right-click into your core libGDX project, Build Path > Configure Built Path...
Select the Libraries tab, Add JARs... and choose box2dlights.jar you've downloaded. Then on the same tab select it and click on the Source attachment. Click on Edit... and browse your box2dlights-sources.jar
//important part
Now, right-click on your libGDX android project, Build Path > Configure Built Path... and do the same as later, but choose your box2dlights.jar located in your core project.
Go on Order and Export tab, check your box2dlights.jar, and move it up, below your gdx-backend-android.jar
still trying to improve my english,
Hope it works!
It doesn't matter.
Put the Jar in the libs's folder of your android project
When you configure the Buildpath, in the Order and export, don't forget to check the box2dlights.jar
By the way, if you still got errors, you should tell us what are them.

How do I load up Google Collections Library in Eclipse?

I'm currently trying to learn to use Guava so I downloaded the source by doing this:
svn checkout http://guava-libraries.googlecode.com/svn/trunk/ guava-libraries-read-only
Sorry if this sounds really stupid but for the life of me, I can't figure out how to load up the source in Eclipse to examine it. I've tried different ways (creating, importing, etc) but always end up with package problems.
I'm using Eclipse 3.5 on Ubuntu by the way.
Can I get some help on this? Thanks!
EDIT: I'm trying to examine the source so I would like to add the source as a project.
Here is what I would do...
Go to the downloads page and grab the latest bundled release
Unzip it to some local directory
Copy the guava-r<version>.jar to your project's lib directory.
Right click on the JAR from Eclipse and say "Add to Build Path".
If you need the source you can attach the guava-r<version>-src.jar in Eclipse via the Configure Build Path project menu or by using the attach source button during debug.
It's easiest to download a Jar from the Guava site, copy it into your Eclipse project and add it to the build path using the jar context menu > Build Path > Add to Build Path. Also, point Eclipse to the included source zip using project context menu > Configure Build Path... to get Javadoc on the Guava classes.
I have done it two ways: the Subclipse and Maven eclipse plugins. Both offer "create project from repository"-like options. Both plugins have reasonable online help, so I'll not repeat exact steps here.
Creating a project from the repositories will give you a full view of the source (and documentation, build files, etc).
I might be a little late in answering ... but you could also simply install the guava bundle from the update site "guava-bundle"; it will install the sources along and you'll then just have to import the plugins in your workspace (File > Import > plugins and fragment... don't forget to tick the "projects with source folder" checkbox on the first page of this wizard) and browse the source from it.
Note that this update site has now been discontinued in profit of Guava-osgi which also provide an update site for easy installation ... but I haven't installed it yet and thus don't know whether the sources are included in the artifacts installed through this update site.

How to install jar library?

I've downloaded the ANTLR Java runtime libraries. It's a jar file. It contains "org.antlr.runtime". Where do I put it so that the Java compiler can find it? Do I need to extract it? I'm using NetBeans (for now), if relevant.
Assuming you can find your jdk folder, You can move the .jar file into the jdk\jre\lib\ext folder, where other .jar files are placed. After doing so, NetBeans should be able to run files with access to the library
For NetBeans you go to your Projects Tab and then right-click on the project you want the library added to then click Properties. Go to the Libraries bullet then on the right side click on Add JAR/Folder. No need to extract it. All you have to do is right click in the editor window and click Fix Imports.
For use outside of NetBeans you have to add it to your Java classpath.
For java command line you need to add it to your class path however in Netbeans you just need to add it as a library. It can be anywhere. Google to find out how to do these things.
In fact in netbeans, you can just say you need this in your maven project and it will do the download of the jar and its source/documentation as required.

Categories