Need LWJGL Setup Guide For Eclipse - java

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.

Related

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.

NetBeans Java OpenGL Library not being found

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.

Eclipse does not work with JSP

I'm following this tutorial about using Google engine API to create web application.
When I add any file with .jsp suffix into my war folder the project will not compile any more.
What can be the reason ? If you need more information please just leave some comment. Thank you.
Can it be that I it cannot compile because I did not download "Eclipse for Java EE developers" but only "Eclipse for Java developers" ?
I'm not sure. I see <Java EE> in the title bar in your Eclipse screenshot which is typical for Eclipse for Java EE developers. So you have likely the right version. If you are able to do File > New > Dynamic Web Project then you definitely have the Java EE version or at least the one with WTP. More detail can be found in Help > About Eclipse.
the error in Markers tab is "Your project must be configured to use a JDK in order to use JSPs"
You need to install the JDK. Go to the Java SE download home page and click the leftmost one of the four big buttons. Done that, go in Eclipse to Windows > Preferences > Java > Installed JREs, select the existing JRE, click Edit and let the JRE home path point to the JDK folder.
It it asking you if you want to run even though it found errors in the project. First, what are the errors and can you fix them easily? Eclipse gives pretty good error messages. If the errors are from validation, turn them off in the project settings, then try running the project again.
Otherwise, double check that you are using the exact code from the tutorial. Copy the code from Google and save it into a separate file. Then select your file, and the new file, right-click on the two files and use Eclipe's file-compare to show you if you missed anything.
[edit]
You could install the EE version to a different directory. Different versions of Eclipse do play nice with each other, they're just huge. Do not import your project into the EE workspace. It will come across as a plain Java project and you need a Web project. Create a new Web/JSP project and then copy the files over.

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 can I install httpclient and other libraries in Java so I can use them in Eclipse?

I'm a new Java developer I've only ever done PHP in the past and all the functions I needed to use were built into PHP. This doesn't seem to be the case with Java though!
I downloaded Eclipse and wrote a hello world and some other things and everything is working great for me! I downloaded httpclient (from http://hc.apache.org/downloads.cgi) and I can see two files, httpclient-4.0.2.jar and httpmime-4.0.2.jar but I'm not sure how I can add them into my program and start using them to build something with!
Any help would be appreciated so much and I'm sorry if this comes off as a trolling question of sorts, I'm really new to this!
Hi in any environment weather it be eclipse, jdeveloper, intellj, netbeans or commandline you need to add the downloaded jar files to the classpath/libraries. This is so the JVM know where to look for external libraries.
In Eclipse in the project explorer right click on the root project and go to properties. Then in the left hand list go to Java build path, once selected go to libraries then go to add external libraries. Once selected they should appear in the list next to the button.
hope this helps.
In Eclipse, right click on your project in the Package Explorer and choose Build Path > Add External Archives... Navigate to your jar files, select them, and click Open.

Categories