Why does my .java file disable errorchecking? - java

Recently I've added a .java file to my Processing Project (its called GClip.java from a library which is called G4P). That .java file helps to copy stuff to the clipboard. I read that on a forum, however directly after I created a new Tab and imported the content from the .java file it gave me that message:
sketch_190108b contains .java tabs. Some editor features (like
completion and error checking) will be disabled.
Now I can't see errors and stuff. How can I turn it back on? I've already tried turning it on in the preferences tab but it didn't work... Any help please?

My guess is this is because the error checking comes from the Processing preprocessor, which turns Processing code into Java code. If you're using a .java file, then the prepocessor is skipped, so it can't do its error checking.
If you want to be sure, you could search for the message in the Processing source code here.
You might consider using a Java IDE like Eclipse or Intellij if this is important to you.
Also, please make sure you're following the G4P copyright license when you copy its code.

Related

How do I import an external jar file and a separate file as a command line argument in Netbeans?

I'm having difficulty with my latest programming project. I have a program in Netbeans which relies upon an external library contained within a jar file. I am expected to use several imports to get the operations I need. While that's all fine and dandy, it also means I can't debug this code to make sure it works. I did see something on StackOverflow about doing a copy-pasta on the jar file into my code, but it uses so many commands and so much code that it would be more helpful to import the whole jar file, if possible.
How do I get Netbeans to recognize that I have an external jar file somewhere that it needs to read from in order to get its information?
Furthermore, I am expected to read in a file via the args[], and I am not sure how to read in command line arguments in Netbeans. How do I do this, and where am I expected to put the file to be read in?
I have figured out my issues and am going to answer this for future reference to anybody with this exact same problem. When you have a NetBeans project, you can open the project hierarchy and get a list of your source packages, test packages, libraries, and test libraries. The Libraries folder is where I needed the jar file.
I can right click on the libraries tab to add a jar/folder. Doing so gave me a file explorer to navigate to where I had my jar saved, and adding it fixed all the warnings for external library imports. The program now knows where to look for all the external libraries. Presumably, I'd have to repeat this if I ever moved the jar file.
As for adding the arguments, I found this under Run>Set Project Configuration>Customize. This brings up a window with the project properties. One of the text boxes will be for "Arguments," and filling this in with your commands will give you those commands as your Args[].

How to disable or fix Class File Editor source not found in Eclipse

Every time I start debugging, after a line or 2 when I step into the code there's a Class File Editor tab that opens up and I lose my breakpoint and debug in eclipse. It is impossible to debug this way. I've tried attaching a source to the jar but to no avail. Can someone help me? I've read somewhere that I do not need to attach source to be able to debug.
Thanks.
While debugging you can normally see the source from the project you're debugging in, from projects added to the class path and from libs in the class path that have source code attached. This brings up the queytions: Where do you attach the source? Is this in the same project you're debugging in?
On the other hand is normally sufficient to debug through your own code. That is you either just skip through the code without source attachment or you explicitely set your breakpoints. Why do you need to see the source of classes that do not belong to your project?

eclipse errors exist in required projects but editor shows no errors

I use eclipse to code in java. My code was running perfectly fine. Finally, i deleted some files which were not needed from my drive.
Right now, I have the source file and the compiled .class files in the correct folders. Also, although I initially had multiple .java files, I am 100% sure that the one I need is there and also that it doesn't need anything from any other thing. All the imports (i import only from standard libraries) are showing no error.
The problem is that when i make any changes in my .java file, and save it, it does get saved but when I execute the code, it runs just like the old version, i.e. the changes are not reflected in the output. Also, on clicking 'run', eclipse gives a warning that 'errors exist in required projects' although the editor shows none.
Whats going wrong ? Please help.
Okay got it....I had added some external jars to my project. Later, when I realised that they were not needed anymore, i deleted them from my hard disk. However, the build path contained their names too among the other libraries (and displayed "missing" after that). I removed them and its working fine.

Files edited outside the ide

If I run a script to edit files outside of the ide I am using, will the ide recognize the changes made to the files?
More specifically:
-IDE: Netbeans 6.8
-Version Control: CVS
-OS: Windows XP
In general, yes. But the form designer of NetBeans considers some parts of the code "private", and you shouldn't modify these parts externally. They are identified by comments in the generated code:
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
These parts are in fact generated from an external proprietary .form file, and having the source code not aligned with the .form code will mess everything up.
Yes it should. Give it a whirl and check it out.
Yes, with some caveats:
If you have those files open, edited, and unsaved in the IDE at the time, then you will need to tell the IDE whether to discard or keep your in-IDE changes.
If you have them open and unedited, then depending on the IDE, you may have to tell it to reload those files (the IDE should warn you that the file has changed since you last opened it).
If you move files around, and your IDE has some kind of project file (that tells it, among other things, where all the files are) and you don't update it accordingly, you may have problems.
Any files that you don't already have open in your IDE should behave as expected, and I would consider it a bug if it didn't pick up the changes.

When trying to open a .java file from windows explorer I get a "No project found to open file in" error message

So, when I double click a file in windows explorer, Intellij fires up, but instead of just showing me the file I want to see, shows up the following message:
I think I get what it means: it means this given .java file isn't associated with an Intellij project.
That's actually true, but even so I'd like to be able to open the file and see it with syntax highlighting and such.
How to overcome this problem?
Thanks
It's a known limitation which we plan to address in the future versions to allow opening and editing individual files without project context.
Please watch/vote the related issue.
I don't think you can'tcan by default. I'm assuming you are opening downloaded files or such. What I would is create a project (Scrapbook for example is a good name) on desktop and I would put/download the file I want to see in the corresponding src folder. That way when I'm clicking it would open properly.
Most of the syntax highlight and such goodness of idea comes from a proper project setup (proper JDK paths, libraries, etc).

Categories

Resources