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
Related
I am having trouble importing Alloy libraries to use the API in Eclipse. This is the code I am trying to run: http://alloytools.org/documentation/code/ExampleUsingTheAPI.java.html
The problem is that I am doing something wrong importing the libraries. So this is what I did:
Create a new Java Project (JRE: jdk1.8.0_172) in Eclipse
Right Click in the project > Import > Archive File > select the .jar file org.alloytools.alloy.dist.jar downloaded from https://alloytools.org/download.html
All folders and files are added as in the next picture below.
Create new file in scr folder: ExampleUsingTheAPI.java, with the code from http://alloytools.org/documentation/code/ExampleUsingTheAPI.java.html
The errors displayed are:
Download the jar, right click on your project, select configure build path, click on libraries and add external jar, select your Alloy api and click apply and ok.
If i'm not wrong it should work, i used to do the same when using eclipse.
I need create hyperlink in eclipse console to link File name on the console to java source file. However, Eclipse only can jump to Java class file in the "referenced libraries" but cannot jump to Java source files.
My project is a Maven project. Any idea to make Eclipse console search files in source code folder instead of only search on the "referenced libraries" ?
My Eclipse is Spring IDE 3.8.4 which is based on the Eclipse Neon.3.
Below figure is OK case, FrameworkServlet.java:489 is a class in referenced libraries.
However if file is a Java source file in src/main/java then Eclipse cannot jump to that file (FileUtils.java)
Thanks.
You simply need to ensure that your source folder is on the build path. Go to your project properties, click Java Build Path in the left pane, click the Source tab in the right pane. If your source folder is not present, add it. Eclipse should be able to find your source file after you do this.
Besides what D.B. mentioned, make sure the source folders is high in the Order and Export tab so that Eclipse would look for current project's source class first.
CLIPC is a library for interprocess communication in Java. I have downloaded it from https://sourceforge.net/project/platformdownload.php?group_id=255796
There were 2 folder inside the downloaded zip file.
1)Exe folder contain clipc.dll and clipc.jar and one other folder
2)source folder contain clipc-java and clipc-native
I dont know How to add CLIPC library in eclipse, I want to run different ipc methods and see result
please help me,thanks a lot
I think what you want to do is go to your project, right click, navigate to "build path", then click on "configure build path". then on the right, click on "add external jars" and choose the clipc.jar file
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.
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.