Yesterday I've imported some Java files within my Java project (just for being able to compile them into *.class files), I have then removed those files and now my Eclipse is constantly showing the following complaints:
Could not move: <the mentioned Java file>
File not found: <again the mentioned Java file>
In top of that Eclipse mentions this issue being present in the plugin "org.eclipse.core.filesystem".
Now I'd like to do the following:
I'd like to go to the file which contains this obsolete reference and delete it in that file. (In Visual Studio this is a piece of cake)
How can I do this in Eclipse? Where does Eclipse store its project file(s)?
Put the mouse cursor on the class or method name in source code and hit
Ctrl+Shift+G.
Related
I'm new at java programming so i just wanted to try something with ssh understand how it works and so i downloaded a java library which is mentioned in this Stack Overflow answer
. After a lot of failed attempts on importing this library into netbeans. I decided to simply put the files into my src folder. But Netbeans ide duplicating packages in the jar file with their 'name equivalent' empty packages and this prevents me to reach the classes in the packages because the IDE and the Code completion automatically sees the empty packs.I've search the network couldn't find anything about this problem.I 'm ready to share any log files if there are any of them .Here is my screenshot about this situation.
Screenshot Attachment
OS : Linux Mint Rosa
IDE : Netbeans 8.1 Linux version
Edit : I Already looked these topics
How to use .jar files in NetBeans? : At first i've tried this and in this solution netbeans not duplicating any empty packs but when i start to type somethin' like that import sshj.foo.*; Auto Complete can't find anything and also if i try to write the whole path to a specific class which is in an specific pack IDE gave me an error the pack that you're looking for is not exist.Secondly I've tried this
and got the same issue at first try.I can see the packs,classes and other stuff but still can't reach them in a random class which is imported project.
How can I include external jar on my Netbeans project : I've tried this and also this ran perfectly without errors as they said but when i try to reach classes still got the same problem so nothing changed.
How to add a JAR in NetBeans :
In this topic all of the replies explained types of libraries.That's not even related to my problem
How to use classes from .jar files? : I've tried to do explained in this reply also and I've transfered my jar file into a compiled .class extension file and this didn't solve my issue too.
I've just solved that problem with downloading part of the libraries from here.
All libraries need to contain three kind of jars ;
1 . Compiled files containing jar (with extension .class)
2 . Source files containing jar (with extension .java)
3 . Javadoc files containing jar (optional)
Open a project find libraries folder on ide right click and choose Add JAR/Folder specify the directory that contains the compiled files.After importing library hit right click over it and choose edit then specify the source files and javadoc files directories you are ready to roll.
I'm working on a Java project in Eclipse that outputs a bunch of text/numbers on to an excel file. I am using a bunch of quickTapSurvey .java files for the project. QuickTapSurvey is just a survey app where users can add/modify the questions according to their needs. I imported the .java files by right clicking on the "default package" and then clicking on the "File system" category. Now that I have all the .java files in my project, they have red "X" marks next to their names, which I am assuming denotes an error (look at the attached snapshots). The code itself has red underlines everywhere. Can someone please tell me what I am doing wrong.
List of imported .java files. note the x marks:
Imported files at the top of the main program:
Your java files reference classes that Eclipse does not know about (they are not found in the classpath). These missing classes are probably related to quickTapSurvey; read their documentation to see how to fix this.
I want to emulate some Java classes and therefore I use the super-source tag in a gwt.xml module.
I created two eclipse projects one only for the super sources and another which contains the app code.
The super source project has the following structure:
/
/super/Emul.gwt.xml
/super/emul/EmulatedJavaClass.java
Emul.gwt.xml contains:
<super-source path="emul"/>
In eclipse I right clicked on the super folder and added it to the Build Path. That works fine. The problem is that eclipse shows an error on the package tag of my emulated java files.
In my emulated package I cannot use:
<super-source path=""/>
This will give an error while compilation.
Can I do something that Eclipse does not show an error in the package and still have all the nice eclipse features like code completion?
There is no enough info about your complete structure in eclipse, but normally:
Your module.gwt.xml should not be in the super path but in the normal folder for sources, ie: src/com/example/Module.gwt.xml with the entry <super-source path="super"/>
Then you can put your super folder in the src, ie: src/super/com/example/MySuperClass.java
In eclipse you have to configure in your project class path src and src/super, but when configuring src there is an option to put exceptions so set src/super as exception.
I am a beginner of Java and Eclipse. Now I have a Java plugin and its source file. I want to debug the source file in Eclipse to see how each part of the code runs. I created a new project named first trial, and the structure is like this:
src\analyser: 1.java,2.java,3.java...
GUI: 1.java,2.java,3.java,4.java,5.java...
GUIPanelWindow: 1.java...
main:1.java...
segmentation: 1.java...
tracking: 1.java
There are more than 5 classes in each package. It's based on the third party-Fiji, so at the beginning of each class it shows the syntax like this "import ij.Prefs","import ij.plugin.PlugIn" and so on.I have also added external JAR files into the library, but it also shows the error "The import ij cannot be resolved ". Thus, the result of debug shows that
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
at main.LineageTracker.main(LineageTracker.java:320)
I want to know if I can debug a Java source file like this or what other steps I should do? I will appreciate your help.
Following up on PM 77-1's comment, assuming ij is in one or more JAR files, here's how to add those JAR files to your Build Path (tested on Eclipse Kepler, the most recent version):
Right-click on your project (first trial) in the Package Explorer.
Select the Build Path submenu.
Choose Add External Archives.
In the resulting JAR selection dialog, choose the JAR files for ij. You can select more than one file.
Hit OK.
The JARs you selected will appear in the Package Explorer, below src, under Referenced Libraries.
Build and hopefully it will work!
I have a Java JAR file that was developed to run in the browser. It works fine. There doesn't appear to be any sort of build file associated with the source code I've been given and I'm attempting to create a project and/or build script.
The source code references some third party code. What I've done is unzipped the JAR file into a folder that has this structure:
\App\src\com
\App\src\META-INF
\App\src\applet
The "com" folder contains subfolders which contain the .CLASS files for the third party libraries. "applet" contains the .JAVA source code files (one folder, maybe 15 files).
The code appears to be written in 1.4 syntax (I manually attempted to compile some of the .JAVA files and it complained that some things were deprecated and/or required the older version).
I created a Java Project in Eclipse and pointed it to the \App folder. Then I went into the Properties for the project and went to Libraries and and clicked on "Add Class Folder" and added the \App\src\com folder. Then I went to "Order and Export" and moved this to the top. I also set the Java Compiler version to 1.4.
I am getting a large number of compiler errors, all of which seem to stem from the fact that it says it can't resolve an import. This import is the set of .CLASS files contained in the "com" subfolders. The namespace matches the directory structure.
This seems like it should be really straightforward, but I've tried various things and don't seem to be making any progress. Based on what I've read I'm sure it has something to do with the pathing but I'm at a loss at this point on how to fix it.
(I'm sure it goes without saying that I'm not a Java dev.)
Any thoughts or ideas as to where I'm going wrong?
Can you please try to right click on Eclipse's Navigator. Select Import>General>archive file> (Jar file that you want to import).
You should be getting the jar file correctly imported at this point. Do tell me if you face any problems.