I have some native files. I need to load those into my project. How can I do so in Netbeans?
I'm loading them with:
System.loadLibrary("SBXPCJavaProxy");
This is pretty forward in Netbeans:
Right click on the Project.
Select Properties.
Click on RUN.
In VM Options TYPE -Djava.library.path="[dir]".
Press Ok.
Basically you give directions to the compiler in which folders to search for available packages.
Note that [dir] should be an absolute path to the folder containing your natives. For example, if your natives are in C:\Natives then [dir] should be C:\Natives.
Related
I've been trying to find a way to attach source into eclipse. I built the spigot.jarand decompiled it into a zip file using JD. Here is the file if you want to take a look at the zip. Now what I'm having trouble doing is attaching the source to a project in eclipse. Yes, I of course have it in my build tools,
but I want to inspect some class' to see if I am using sockets/packets correctly. Here is the picture that eclipse gave me. I've already attached the source to that zip, but it wont work.
Any ideas?
You need to add the built jar file the buildpath of your project. In eclipse just right-click your project, click on "Properties", select "Java Build Path", select the tab Libraries and click on the button "Add External Jar" on the right side. Then choose the Bukkit/Spigot jar file you want to work with and build against on export.
If you need a detailed video tutorial on it:
https://www.youtube.com/watch?v=7dyopdta7ZI
I am working on a project where i need to know the contents of jar file included in my web-project. I am using Eclipse juno. However Netbeans provides these features to view the contents of a jar-file. Please suggest me how to achieve this in eclipse.
In the project explorer, you should have something with an icon looking like a pile of book like those:
just expand the one containing your dependencies (probably labelled "Referenced Librairies") and you can browse as usual.
NB: you will probably need to specify where the sources are for each jars (right click on a jar > Properties > Java source attachment)
[image is courtesy of JBoss community]
Please use the Eclipse plugin zipeditor in order to view the content of jars, zips or wars: Enter update site: http://zipeditor.sourceforge.org/update and enjoy. That is the best choice so far to handle archives in Eclipse.
The jar will need to be added to the build path in the libraries tab, if it isn't already, in order to be viewable under referenced libraries
I'm having a build problem with a specific file that I'm not being able to change the path on my Android project. Here is a picture of the problem:
How do I change this Path: /Users/apple/Downloads/dolphin_player/p/libs shown in the picture?
Change it from the libraries tab. You cannot do it from the order and export tab.
On the libraries tab, remove or edit it.
Its very simple, just follow these steps,
Right click on your project, select properties,
From the dialogbox select "Java Compiler" in left part, see image
It depends on the which version of java you are using.Just go to library tab and do following.
If you are using the 1.6 version of java the whenever you want to add any third party jar files you have to add it by adding external jar file in the library option.
If you are using the 1.7 version of java then you have to make a folder called libs and put the all the external jar files in this folder. It will automatically add the files to yous build path and add it in "Android Dependencies".
This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
Android project unable to reference other project in eclipse
I have an eclipse java project. I don't see a bin directory. It has an application and it runs fine. However, I have problem. I need to include some of those classes in another project, namely an Android java project. So there are two things I really don't understand how to do:
1) Specify an output folder so there is a real visible bin directory in this project?
2) auto generate a .jar file with these classes so that I can include the jar file in another project.
Yes, I am an experienced programmer, and no it is not at all clear to me how to do this looking at the options under project properties. Including just the whole project works for compiling, but at runtime the classes from the java project are missing.
1) Specify an output folder so there is a real visible bin directory in this project?
The directory is there, but Eclipse hides it by default. If you want to see it, you will first need to switch to the 'Resource' perspective (Window -> Open Perspective -> Other..., then select "Resource" and click OK). From there, click the downward triangle button in the Package Explorer view (top-right corner), then select "Customize View..." from the dropdown menu. Deselect the "Java output folders" option and click OK.
If you want to change the location of this directory for whatever reason, right-click any Java project, the select "Build Path" -> "Configure Build Path". The location of the output directory is specified in the "Source" tab.
2) auto generate a .jar file with these classes so that I can include the jar file in another project.
As mentioned in Code Droid's answer, a better option is usually to modify the build path to include the project that contains the files as a dependency. However, if you really need the jar file, one easy option is "File" -> "Export...". Under "Java", you'll find "JAR file" (or "Runnable JAR file", if you want to make it executable using the -jar option). Once you select the classes you want to include, click "Next", and you'll have a chance to save the configuration so that you can easily perform the same export operation in the future.
Im new to eclipse , can anybody tell me how to use an JAVA API in eclipse. or share any sample Java API.
Yes, how to use JavaDoc file in eclipse.
Yes, how to use JavaDoc file in eclipse.
You can download the Javadoc jar file from the respective project and include it in your build path
Eclipse==> project-->properties-->Java Build Path-->click on the jar file--> edit JavaDoc
Point it to the API URL location/Downloaded Jar file,
Typically, shift + F2 opens the API when the class is focussed upon
Do you mean: how to use a third-party Java library in your Java project in Eclipse?
Right-click your project in the Package Explorer and choose Properties. Go to "Java Build Path". Click "Add JARs" or "Add External JARs" to add the JAR file(s) of the library to your project.
"Add JARs" is for adding JAR files that are in your project directory. "Add External JARs" is for adding JAR files that are not in your project.
Note that the Eclipse help (Help / Help Contents) contains a lot of information, including information on how to work with Java projects in Eclipse and how to add libraries to your Java project.
Here are some nice Eclipse video tutorials . The version of Eclipse is dated ( 3.1 ), but the concepts are still there.
I'm not clear exactly what you're after, but if you create a new Java project, you will have access to the JRE system library's contents as a classpath container.
File->New->Java Project, enter project name, select OK.
You'll then be able to create new classes and access the Java classes.
If you want to reference another jar containing the "API", you can add it to the project's build path.
Say the jar is in the "lib" folder of your project, open the project properties (alt+enter), the Select Java Build Path, then the Libraries tab, select Add JARs..., then browse to the lib folder and select the jar you want to add and select OK.
To attach sources and javadoc to the jar, you can expand the selector in the Libraries tab, click on Source attachment and Edit... and browse to the location of the sources jar/zip, repeat for the Javadoc. The screenshot below shows you the Source attachment option for rt.jar
(source: vogella.de)
and ok back to the workbench.
You should now see that the jar is included on the project's path (the jar has a little overlaid icon on it).
If this is not what you're after, can you rephrase the question?
what you need to do is to hover mouse over some in-built method or class that are using in your program. Hold ctrl on your keyboard and click. Then eclipse asks you to attach source. click on 'attach source', browse for src.zip file after choosing 'EXTRENAL' file. or instead give path for extracted src folder under same ie external file attachment. Next time you hover over an in-built class or method it shows a small description. To view entire javadoc for same, keep holding ctrl and click on it. It worked for me.