Eclipse does not recognize org.jdesktop.* - java

I use JRE system Library [jre7] and when I import org.jdesktop.application.Action I get
The import org.jdesktop cannot be resolved
I removed the build path by Build Path > remove from build path and then I did
project > properties > java build path > add Library > JRE system Library and still same error .

If anyone is interested, I had to download 3 JARs:
appframework-1.0.3.jar (link in previous post) wich contains org.jdesktop.application classes,
swing-layout-1.0.3.jar link wich contains org.jdesktop.layout classes,
swing-worker-1.1.jar link wich contains org.jdesktop.swingworker classes, required by the others jar

The org.jdesktop code is not part of Java SE, so the classes won't be in the JRE. You need to locate and download a JAR file containing the classes, and then add it to your Eclipse buildpath.
(One place to download the JAR is here ... but it is easy to do your own searching if this link breaks. Go to Maven Central or findjar.)

Just download the corresponding jar file from here . And you are good to go.
Add the jar to your build path.

Related

Error jsoup in Eclipse

I am still receiving errors due to jsoup in eclipse. I have dropped the JAR in the project's tab, rightclick the JAR file and then chose Build Path > Add to Build Path but it still does not work.
http://imgur.com/SCqLxWN
Could you please help me?
#Thank you for responses!
I have done as you advised me but it still does not work.
http://imgur.com/Y5B9Em2
I am just a beginner but when I am using other packages everything works, I have troubles only with this jsoup. Do you have any other ideas?
Create a folder named libs in the root of your project and put your jar files here. Then go to project Properties, under Java Build Path > Libraries click on Add JARs... and select you jar file, under the libs folder.
Try to remove the following code as your class is inside the default package.
package org.jsoup.examples;

Automatically load libraries on project creating. Android, Eclipse

I have figured out how to obtain the effect i desire on the desktop.
(Window > Preferences > Java > Installed JREs > jre7 [Edit] > [Add External JARs])
but i cant get the same effect on android.
In the desktop project i can see the folder "JRE Sysytem Library(jre7)" contains all the JARs i referenced
This directory is not present in the android project. How do I add libraries to be automatically included in an Android project without needing to use the "R-Click Project > Properties > Java Build Path > Libraries" method OR the "R-Click JAR file > Build Path > Add to build path" method in the IDE "Eclipse"
In the desktop project i can see the folder "JRE Sysytem Library(jre7)" contains all the JARs i referenced
An Android app does not use the JRE.
How do I add libraries to be automatically included in an Android project without needing to use the "R-Click Project > Properties > Java Build Path > Libraries" method OR the "R-Click JAR file > Build Path > Add to build path" method in the IDE "Eclipse"
That is not possible, sorry. Android does not use Eclipse's "Add External JARs" regardless of whether it is manually or automatically populated. It only uses JARs in libs/ or attached Android library projects.
Eclipse doesn't provide this functionality, I believe.
You can on the other hand Select configure build path and just add the libraries.
Put the jars in the "libs" folder in your android project root folder. They will be used and exported from the build system (ant/gradle).
This link will help let you know what each folder in an android project could be used for here:
http://developer.android.com/tools/projects/index.html#ApplicationProjects
Another way would be to setup an Android Library Project which includes common dependencies of your projects, so you could add this library project as dependency in the Project->Properties->Android - Section.
Since nobody gave me an answer to my question (although they all of you did provide useful info and i think you for that) I will post the solution i found (but have not yet implemented)
I am using libgdx to create my applications so after looking and searching for a way to have eclipse automatically include libs when generating an android project, i realized that the answer was obvious (but not easy to do)...
i downloaded the libgdx source from github, learned how to use command line git and ant, and followed their instructions to get the source running. i now have the setup ui project working out of source. and am beginning my day by trying to get the libs i use included in the setup...
i know its possible and will edit this post with information on if/how i managed to accomplish this lofty goal

Problema with the java build path with my private lib

i have a doubt.
I import one proyect and there is an error.
Description Resource Path Location Type
Archive for required library: 'C:/Users/NadirFagot/Desktop/Proyecto Fonta/Irlanda/supporting/GROUPEE/libs/._android-support-v4.jar' in project 'GROUPEE' cannot be read or is not a valid ZIP file GROUPEE Build path Build Path Problem
When i go to the proyect properties and java build path and libraries, i try to remove in the android private libraries one of the files android-support-v4.jar, because there are two but i can't.
I tried to delete the hidden file jar in the window view in my folder libs and install it with the android tools but it doesn't work too.
I don't know what i have to do...
PLEASE HELP!!
THANKSS
If your library projects contains android.v4 support jar you can remove from your project and clean the project..

Netbeans not building the lib folder in the dist folder

I am trying to clean and build a jar but for some reason when I do a Run-> Clean and Build Main Project, I don't get a lib folder in the dist folder. This is causing a missing classes error when I run my jar file via cmd. How do I configure it to have the lib folder in my dist folder during my build? Thank you.
Edit:
Also, when I hit Run->Clean and Build Main Project, the output says the following:
2 warnings compile: Created dir: C:\Documents and
Settings\me\Desktop\ProjectX\ProjectX\dist C:\Documents and
Settings\me\Desktop\ProjectX\ProjectX\dist\ProjectX.jar is a directory
or can't be read. Not copying the libraries. Not copying the
libraries. Building jar: C:\Documents and
Settings\me\Desktop\ProjectX\ProjectX\dist\ProjectX.jar To run this
application from the command line without Ant, try: java -jar
"C:\Documents and
Settings\me\Desktop\ProjectX\ProjectX\dist\ProjectX.jar" jar: BUILD
SUCCESSFUL (total time: 3 seconds)
Why is it not copying the libraries during the build?
According to this forum.netbeans.org (cached copy as forums.netbeans.org is not accessible atm) article this could be caused by ProjectX.jar being added to the required JARs for some mysterious reason... Could be worth checking
EDIT: cached copy seems to have disappeared, the original thread can be found here.
EDIT again: as both the original and the cached copy have disappeared, head over to the wayback machine to read the article. That being said, anno 2018+ one should probably consider using a more modern / widespread project format like Maven, which is also well supported by Netbeans and offers a much more flexible libraries management approach.
In my case I went to Libraries->Properties. The "lib" folder was added as a library. remove it or remove them (several folders as libraries) and do clean and build.
Hope help you.
The url provided by #fvu die.
However I also have that problem and fixed it.
Exit Netbean
Delete your-project-name/nbproject/private
Open Netbean
Clean and build
In my case, I solved the same problem as follows :
1) Go to Project > Libraries > Properties > Libraries > Compile
2) Select missing libraries beginning 'Missing library :' and remove them
3) Clean and build
Cheers.
The problem is that you add the folder where are you libraries, you need to actually add the libraries and not the folder where they are.
1) Go to Project > Libraries > Properties > Libraries > Compile
delete the folder you add in these case C:\Documents and Settings\me\Desktop\ProjectX\ProjectX\dist
Select add JAR/Folder and these time open the folder and add all the libraries inside, Netbeans will allow you to select it all.
Now you suppose to be good.
There is a setting in Net Beans. Right click on Net Beans project you have created.
Click on Build->Packaging. You will get 03 options on the right pane
Compress JAR File
Build JAR after Compiling
Copy Dependent Libraries
Select the 03rd one and then build. You can see the /lib folder under /dist

No projects are found to import - Helios eclipse

When downloading the 64 bit for Helios eclipse claims that there are no projects found to import - the file is swt-3.6-win32-win32-x86_64.zip
This should be fairly straight forward!!!!
On top of what Joe said:
The build path page is located in Properties (right click on project) -> Java Build Path. You can find the Libraries tab there.
I'd add one more step to the aforementioned workaround:
1) Extract the swt-3.6-win32-win32-x86.zip file (or another version, whichever you need)
2) The extracted folder contains 2 jar files swt.jar and swt-debug.jar
3) On the Java build path page of your project, open the Libraries tab. And add the swt.jar as an external jar.
4) Expand swt.jar on this tab, double click "Source attachment" and point to the archive named swt.zip (also comes in the top-level SWT archive), so that the javadoc will also be available for you.
And that's it - SWT should work like a charm from now on. Hope that helps.
There is a bug report on this: https://bugs.eclipse.org/bugs/show_bug.cgi?id=318680
I tried the recommended workaround (included below), but could not find the build path page, nor the Libraries tab, referenced in the workaround.
Instead, I right-clicked on the HelloWorldSWT package (in the Package Explorer window), selected Build Path -> Add External Libraries, and selected the jar file swt.jar. As the tutorial warns, there were compile errors, so I selected Source -> Organize Imports. The program now compiles and runs, but does not do anything. Inserting System.out.println() statements shows that it dies in creating the new Display().
I don't know if this helps [anyone], but I figured I'd share what I've tried so far. If anyone has any suggestions, they would be welcome.
For reference, in case it matters, I'm running Eclipse Helios (3.6) on Mac OS X (64-bit).
Here's the aforementioned workaround:
Lakshmi Shanmugam 2010-07-02 11:16:01 EDT
The step to import the SWT project from the zip is no longer valid. The
cheatsheet needs to be updated.
Please follow the below steps:
1) Extract the swt-3.6-win32-win32-x86.zip file
2) The extracted folder contains 2 jar files swt.jar and swt-debug.jar
3) On the Java build path page of your project, open the Libraries tab. And add
the swt.jar as an external jar.
Can't confirm - I just downloaded said file from the download page with no problem.
Importing projects is a workbench activity and not related to the eclipse installation process. Try a fresh install of a full 64Bit platform (one of the distributions from eclipse.org).
I have the same problem. There are instructions in the SWT HelloWorld tutorial linked from the Helios welcome page that instruct the user to first import the SWT project using File > Import ... then selecting Existing Projects into Workspace. When you specify the SWT archive, you get the error mentioned above "no projects found to import"
I think the problem is that the tutorial needs to be updated to reflect the fact that this archive is not an eclipse project and so cannot be imported in this fashion.
While it cannot be imported as a project, the jar can be linked; or, the source files can be turned into an eclipse project and the otherwise erroneous instructions can be followed from there.

Categories

Resources