I recently downloaded the microba datepicker and it comes with three JAR files: the source code, the compiled coled and one JAR for javadoc.
I use netbeans and tried everything within my limited abilities to get access to that documentation, but just couldnt make it ... can you help me please to solve that problem?
To read the javadoc from a .jar-file one first has to unpack it. To do so, open your console, navigate to the folder where the jar file is located an unpack it using the following command:
jar xf yourFileNameHere.jar
Then you can access the documentation.
First you need to unzip the zip-file to your preferred location, go to your netbeans and on your project you search for Libraries and you right click on >>>Libraries and select >>>Add JAR/Folder located your extracted file and then click on open.
Try this method, Right click plusztester(prototyp) project and select >> Resolve Project Problems select the missing files and resolve them by locating the right files.
Related
I am trying to use an external .jar file in my project. I have put that .jar file in my project's /lib folder, and I have referenced it in the build path. However, when I try to use it in code, I can't get the javadoc for it, nor I can see the actual code from the referenced classes. It says it has no source attachment. What is it meant by source attachment? I do have a javadoc folder that came with it, but when I attach it to my build path, it still reports it could not found the javadoc for the classes. Any ideas on that?
I want to be able to see the javadoc.
The .jar file is the generated packed classes of the java code. Some jars will come with java doc and code and others won't.
For recent Eclipse versions:
right-click the jar in question (in the referenced jars, not the physical jar) and choose Preferences -> Javadoc. Here give a correct location (zip/URL) to the correct javadoc. (Select Validate!)
For older Eclipse versions:
First: Navigate to the jar itself in the Eclipse project explorer (to the left) and try to open aclass of the jar. Then, you will see the warning that it has no source attachment, and a button to attach the source code.
Then, push the button, select "external folder" and then navigate to the folder with source you already have.
hope I got you right:
try to right-click the jar in the references jar tab and go to Preferences -> Javadoc.
choose the right location to the correct javadoc and press "Validate" afterwards
Jar files can be built with or without source code. It's normal for 3rd party applications to produce a binary jar and a source jar, but it isn't required. The message is telling you that it doesn't know where the source code is for the library you are using. It's been a long time since I've done this in eclipse, but there is a way in the project settings to point each library jar to the corresponding source location (which can be a jar, zip file or directory).
Here are a couple of references
Attach the Source in Eclipse of a jar
Attaching the source to a library in eclipse
I'm trying to create a simple login form using servlets connected to database. But I got this error:
No JDBC driver found
I had added mysql-connector as external JAR file. After searching for solution on stackoverlow, it was suggested instead of adding it as external JAR file, copy paste it into WEB-INF/LIB folder. But whenever I try that, it gives me error:
Cannot paste clipboard contents into selected elements
How can I resolve this?
EDIT 1: Eclipse not allowing me to drag-drop either
To fix it in that case, extract the file(s) from the archive first(.rar,.tar,.zip), then c-and-paste the file into Eclipse. Works for me under Package Explorer, too.
OR Go for
project->clean
just go through that
Eclipse & JAR Hell
May be that Help you out !!
Instead of copy paste try to drag file and place it in web-inf/lib folder
please Be sure that the file is not from a zip folder.
If it is from zip folder extract it , then copy paste the file.
download winrar-x64 /winrar-x32
install winrar
now unzip ur files
copy paste in eclipse
Best Solution:
Yes i try to start learning JDBC and had to face this issue.
I read the stackoverflow posts but nothing seems to be solving my issue.
Then i did one thing
1.Right click the project
2.Go to properties
3.java Build path
4.libraries
5.Add external Jars
6.Add the jar file
7.hit ok to save
8.Then copy and paste same jar file into the project that you have done before
9.Success!you won't see any error prompt
I am happy now and i hope that you too when you follow this procedure 😊
My instructor asked us to do a homework assignment in Eclipse and save it as a JAR file so he can open it in his own Eclipse... Previously, I've always zipped my .class files and sent them off, so I don't quite know how to do this...
I did find that I can "export" to a jar file, but when I try to open it again I can't figure out how... so I don't know if I exported it properly or if there's just some unknown method he uses to load it into Eclipse afterward.
Yes, "export" to JAR file is the way to go. To check what it contains, please understand that a jar file is in fact a zip file with a different extension, and so you can make a copy of the jar file, change its file extension to .zip then unzip it, and you'll see if it contains what you need.
Edit
I suggest that you use Export to JAR (and not Export to Runnable Jar) since this has the option of exporting the source files as well.
If you do this, you will see:
and you will wish to make the selection Export to JAR as noted in the figure.
Next you will see:
Which is where you choose the files that should be part of the JAR. Make sure to click "Export Java source files and resources" so that your jar file has text readable source. When done, don't click Finish, but instead click Next >.
Then you will see
The Jar Manifest Specification, where you choose which file that holds the main method, that should be run, by entering it into the Main class: text field, or by finding it using the browse button next to the text field.
Then once you've selected the main file, click Finish:
And you're done. Be sure that in the Jar File Specificaion you choose to export the source files.
In Eclipse you can right click on the project and choose "export as jar"
You could also see the documentation.
In Eclipse, right click on your project in Project Explorer. Then go to export and select JAR file. From here you select which files you want to include and a destination for the JAR file. Once complete, you can attach this to an email and send to your Professor.
Hope I could help.
I'm a complete novice to Java, and I'm stuck in trying to use an external jar library in a Java project I'm working on.
The library is Twitter4J (http://twitter4j.org/), a complex group of files which I can't understand how to include. I'm using Eclipse on Windows. I understood the meaning of CLASSPATH enviroment variable (or well, I think I did), but I can't understand how to link it to the Eclipse enviroment.
This blog post seemed to be what I was looking for: http://jasperpeilee.wordpress.com/2012/01/25/how-to-set-up-twitter4j-quickly-in-your-java-project/
But:
Add twitter4j-core-2.2.5.jar into project for general use.
1) Where should I copy the core file? In the /bin/ folder? Or in a completly unrelated /lib/ folder, as this question in SO stated?
Copy Twitter API property file into your project/bin directory.
2) What is the Twitter API property file?
3) How can I include JavaDoc jar files too? Is it possibile to get them into Elipse?
Any kind of help, even just a link, will be very appreciated!
You probably have a project folder for your Eclipse project. Go ahead and make a lib folder inside of your project folder, in the same directory as src and bin. There's nothing special about the lib folder specifically, it's just a convenient name. Copy the .jar file into your newly created folder. Back in Eclipse, right click your project and click Refresh. The lib folder should pop up, including your JAR! Right click the JAR file and go to Build Path --> Add To Build Path. At this point, any class in the project should be able to use Twitter4J features.
As for the What question, the Twitter API property file contains configuration that is necessary for the Twitter jar to function. The file should probably be located on the classpath of your application.
And the How question, you can attach the javadoc jar file of the Twitter jar to the Twitter jar's classpath entry in Eclipse. Right-click your project and select Properties. Go to the Java Build Path entry and find the Twitter jar under the Libraries tab. If you expand the Twitter jar entry you will see 'JavaDoc location'. You can specify the javadoc jar there.
In Eclipse, right-click your project, select Properties. Now find the entry for Java Build Path and select it. Click the "Libraries" tab if it is not already selected. Click the "Add external JARs..." button. Follow the prompts.
I added a Student.jar into my Build Path in my eclipse like this-
Right click on the project->BuildPath->Configure Build
Path->Libraries->Add External Jars
There is one class named StudentTest in Student.jar file. When I was debugging my code in eclipse, I stepped into that StudentTest class in the Student.jar.
And after that eclipse shows me like this-
The JAR file S:\some_location\Student.jar has no source attachment.
You can attach the source by clicking Attach Source below
Now I am not sure how should I attach the source in my eclipse. And from where? Can anyone provide me step by step what I need to do.
Update:-
I tried unzipping the Student.jar and I got Student folder. And after that I tried pointing the source to Student folder But still I am not able to see the class properly so that I can debug it properly, it shows the same above behavior.
Use Java Source Attacher !
It does what eclipse should do - a right click context menu that says "Attach Java Source.
It automatically downloads the source for you and attaches it. I've only hit a couple libraries it doesn't know about and when that happens it lets you contribute the url back to the community so no one else will have a problem with that library.
Eclipse is showing no source found because there is no source available . Your jar only has the compiled classes.
You need to import the project from jar and add the Project as dependency .
Other option is to go to the
Go to Properties (for the Project) -> Java Build Path -> Libraries , select your jar file and click on the source , there will be option to attach the source and Javadocs.
A .jar file usually only contains the .class files, not the .java files they were compiled from. That's why eclipse is telling you it doesn't know the source code of that class.
"Attaching" the source to a JAR means telling eclipse where the source code can be found. Of course, if you don't know yourself, that feature is of little help. Of course, you could try googling for the source code (or check wherever you got the JAR file from).
That said, you don't necessarily need the source to debug.
This worked for me for Eclipse-Luna:
Right Click on the *.jar in the Referenced Libraries folder under your project, then click on Properties
Use the Java Source Attachment page to point to the Workspace location or the External location to the source code of that jar.
Go back in to where you added the jar. I believe its the libraries tab, I don't have Eclipse open but that sounds right. to the left of the jar file you added there should be an arrow pointing right, click that and 3 or 4 options expand, one of them being the source file of the library. Click on that and click edit(I think you can also double click it) then locate the file or folder on your hard disk, you probably have to click apply or okay and you're good to go, same with javadoc and i think the last one is native libraries. I don't pay much attention when I'm in there anymore if you couldn't tell. That's what you were asking, right?
I Know it is pretty late but it will be helpful for the other user, as we can do Job using three ways... as below 1)1. Atttach your source code using i.e, Right click on the project then properties --> Java build path--> attach your source in the source tab or you can remove jar file and attach the source in the libraries tab
2. Using eclipse source Analyzer In the eclipse market you can download the plugin java source analyzer which is used to attach the open source jar file's source code. we can achieve it after installing the plugin, by right click on the open source jar and select the attach source option.
3. Using Jadclipse in eclipse you can do it last not the least, you can achieve the decompile your code using this plugin. it is similar way you can download the plugin from the eclipse market place and install in your eclipse.
in jadclipse view you can see your .class file to decomplile source format note here you cannot see the comment and hidden things I think in your scenario you can use the option one and option three, I prefer option three only if i want to the source code not for the debug the code. else i ll code the option 1, as i have the source already available with.
Simply import the package of the required source class in your code from jar.
You can find jar's sub packages in
Eclipse -- YourProject --> Referenced libraries --> yourJars --> Packages --> Clases
Like-- I was troubling with the mysql connector jar issue
"the source attachment does not contain the source"
by giving the path of source folder it display this statement
The source attachment does not contain the source for the file StatementImpl.class
Then I just import the package of mysql connector jar which contain the required class:
import com.mysql.jdbc.*;
Then program is working fine.
I faced the same issue and solved using the below steps. Go to Windows->preferences->Editors->File Associations
Here click on Add
then type .class
click on OK
again click on Add
then type .classwithoughtsource
click on OK
Now you will be able to see JadClipse option under Java section in Windows->Preferences
Please provide the path of jad.exe file as shown below.
Path for Decompiler-C:\Users\ahr\Documents\eclipse-jee-galileo-SR2-win32\jad.exe
Directory for temporary Files-C:\Users\ahr.net.sf.jadclipse
click on Apply
Now you should be able to see the classfiles in proper format.
It is quite possible, just go to the jar in the Build Path and choose to attach a source just like follow.
Download JDEclipse from http://java-decompiler.github.io/
Follow the installation steps
If you still didn't find the source, right click on the jar file and select "Attach Library Source" option from the project folder, as you can see below.
I am using project is not Spring or spring boot based application.
I have multiple subprojects and they are nested one within another.
The answers shown here supports on first level of subproject.
If I added another sub project for source code attachement, it is not allowing me saying folder already exists error.
Looks like eclipse is out dated IDE. I am using the latest version of Eclipse version 2015-2019.
It is killing all my time.
My intension is run the application in debug mode navigate through the sub projects which are added as external dependencies (non modifiable).
I have faced same problem and resolved it by using following scenario.
First we have to determine which jar file's source code we want along with version number. For Example "Spring Core" » "4.0.6.RELEASE"
open https://mvnrepository.com/ and search file with name "Spring Core" » "4.0.6.RELEASE".
Now Maven repository will show the the details of that jar file.
In that details there is one option "View All" just click on that.
Then we will navigate to URL "https://repo1.maven.org/maven2/org/springframework/spring-core/4.0.6.RELEASE/".
there so many options so select and download "spring-core-4.0.6.RELEASE-sources.jar" in our our system and attach same jar file as a source attachment in eclipse.
Try removing the breakpoints. :)