I cannot create a new Java application in NetBeans 7 - netbeans

I've just installed NetBeans 7.3.1.
I'm just trying to create a new Java application but whenever I go through the wizard it says "Project folder exists and is not empty" and won't go any further. This is a new project so the folder does not exist until NetBeans creates it.
Any ideas?

First thing I'd suggest is to look for any anti-virus in your system that is not letting your NetBeans create any new Project.
You can try :
1 Disabling your anti-virus and try again.
2 Installing IDE in any other Drive except C Drive.
3 One more method but it is bit complex
Step 1: See if you can create a new project in a folder that doesn't
exist yet. Suppose the IDE does make this new folder for you, starts
filling it with files, then stops unexpectedly and says that 'Project
folder already exists, etc'.
Step 2: Look inside the folder and try
to locate the main class for your application (e.g.,
C:\NetBeans_Projects\MyNiftyJavaApp\src\myniftyjavaapp\MyNiftyJavaApp.java)
Step 3: If the main class file does exist but is totally empty (0
bytes in length) it might mean that something prevents the IDE from
filling it with automatically generated code (as happened to me
because of the invalid main class template).
Last thing you could do is upgrading your NetBeans version.

Related

Netbeans says newly created file already exists, file is blank

Ok, so, using Netbeans for a small Java project. Anyway, it was working fine this morning. Then, after working on another project briefly and switching back, something changed.
Now, when I create new .java files, it says they already exist - but, they didn't, until then. That is, the filename didn't exist, and once I made it, it said it already exists, which, after it says that, it does. Which, well, the file didn't exist before, so it is a problem.
Secondly, the file it creates is blank. It is much easier to use when it creates it using the template: automatically adding the package statement, and class structure.
This persists across a restart.
Sounds similar to this: Netbeans creates file, then complains it already exists
On Windows 7. Netbeans version 7.3
Any ideas how to fix?
EDIT:
I think I may have found the cause. I had changed the default class template, or more accurately, took a few sections out of the default. Apparently the second time I did it, I also erased a bit of the template markup, and it was this syntax error that ended up making this happen. After fixing the syntax error, it seems to work.
I had similar experience:
Every time I right clicked in Netbeans 8 to get a new Class in a package I only got a empty file and a complaint about that the file already exist.
The solution was for me to go to Tools -> Templates -> expand Java folder -> select "Java Class" -> press "Revert to Default"
The solution is go to Tools -> Templates -> expand Java folder -> select "Java Class" ->
open in editor
use this code in java class file
<#if package?? && package != "">
package ${package};
public class ${name} {
}
I had the same issue once. I used Netbeans IDE 8.2v with a dedicated Java pack pre-installed. Even after reinstallation, this error couldn't be fixed for me. In a previous Netbeans version, I changed the template forms according to my way - this was the cause of the file/class already existing error for me. After another reinstallation process, I manually reverted all changed templates to the application default way. You can do it out & fixed this error. It worked for me!
PATH : Netbeans >> Tools >> Templates >> a single click on Java folder >... to your right-hand side there's a button pannel >... click on 'Revert to Default'
I had this issue and none of the previous stated solutions worked for me. I found that simply copying the created file directory i.e C:\Users\Bill\Desktop\randomjavafile.java and deleting the file and then trying again works :).

Eclipse Crash "java was started but returned exit code = -805306369"

I'm aware there is an identical post here but none of the proposed solutions have changed anything and they are quite old (problems to do with Java6) and seem to be referring to a bug to do with Eclipse.
My problem is when I am developing in Eclipse for RCP and RAP Developers; either making changes to java files or changing dependencies etc, Eclipse randomly hangs and then freezes. I have to force close eclipse and I get this message
Things I have tried so far:
Restarted eclipse and PC
Added the -clean command to the very beginning of the eclipse.ini file
Created a brand new work space and attempted to develop in that
I'm running on the latest version of Java (1.7.0_13) and haven't got a clue what to do next.
The problem has happened 4 or 5 times in a number of different occasions:
When I have tried to add a new package to the src folder
When I have tried to add a class to a package in the src folder
When I have tried to edit a class in a package in the src folder
When using Ctrl+Space in a class in the src folder
Any advice/tips would be greatly appreciated! Need to get this problem sorted so I can get developing for my 3rd Year University Project :)
java was started but returned exit code = -805306369
is caused by Eclipse´s corrupted workspace, I solved my problem with these 3 steps:
1) Go to your workspace and rename it.
2) Start your eclipse and by default it will create a workspace.
3) Go to File -> Switch Workspace, choose your original workspace.
After a lot of researching and filing bug reports to no avail I tried one last clear out of Java and fresh installs of Eclipse to try and fix the error and it seems to have worked.
Here is what I did:
Un-installed Eclipse for RCP and RAP developers
Un-installed Java from my PC and deleted any old Java folders that were left behind (I didn't do this in previous clear outs so maybe there was an old version of Java messing something up)
Did a fresh install of Eclipse for RCP and RAP developers and a fresh install of the latest Java
I also deleted my old PATH variable for Java in Environment Variables and put the new one at the front of all the other entries
This seems to have fixed the error for now so hopefully it won't be a short term fix
I opened another instance of eclipse and it prompted me to choose a new workspace. I did so and there it was resolved. Then I closed the new workspace and resorted back to old workspace as usual.
If using Maven projects, check pom.xml, this may corrupted. Mine resolved by fixing pom file.
java was started but returned exit code = -805306369 caused by Eclipse´s currupted workspace, I solved my problem with this 4 steps:
Close Eclipse.
Kill the adb from task manager.
Start Eclipse and by default it will create a workspace or start with new workspace.
Go to File -> Switch Workspace, choose your original workspace.

Can't find main class in NetBeans 6.9

Whenever I load NetBeans 6.9 (similar errors happened on previous versions also) then I let NetBeans finish scanning my projects and once it's done I try to run a profile which points to a class with a main method, NetBeans always says the main class is not found, even though it shows up in the list of classes once the error pops up.
If I select the class from the list and hit OK, the same error happens again (main class not found).
If I compile the main class, I still get the same problem.
I think I still get the same issue if I rebuild the entire project.
-> when I compile the main project it compiles all projects, even those that are closed.
What is going on?
The only way I have found so far to work around this is to close the project and re-open it and wait for the project scan to finish again.
This is incredibly annoying. Is there a fix for this?
Another strange thing I noticed is that my project seems to be building into the wrong JAR file name (though if I do the above step of closing and reopening the project it still works). I have two projects with different names, and even after having closed the other project and restarted NetBeans a lot of times, when I build the first project it uses the JAR file name for the second project that has been closed for a long time.
I fixed a very similar behaviour by deleting NetBeans's cache. Delete the folder User\.netbeans\6.9\var\cache\index\.
Windows 7 and Netbeans 7.2:
User\AppData\Local\NetBeans\Cache\7.2\index
I didn't read the complete question, but try: Right click project > properties > run > browse for main class
Else try making a new project and then copy the scr folder from the old one to the new project.
For windows 8
Delete this directory C:\Users\Shubham\AppData\Local\NetBeans\Cache
Before doing so close netbeans.
Start Netbeans again and let it read the project.
Test project. Run project. It should work fine.

How to copy an eclipse dynamic web project?

I have a workspace with a dynamic web project in it. When I try to copy and paste the project into the same workspace, eclipse asks for the name of the new project, then it copies the files.
The problem I have is that when I deploy this project to the server it gets deployed with the original name and not the new name.
It looks like eclipse is not updating all the old name references when it makes the copy.
How do I make a good clean copy of an existing project?
After some more searching I found this in the eclipse bug site.
Steps To Reproduce:
create a Dynamic Web Project and call it "Project1"
copy and paste this project, in order to create another one which is a clone
of the first; in the "Paste" dialog, specifiy "Project2" as the name of the
target project (instead of "Copy of Project1")
OBSERVED BEHAVIOUR:
The context root of the target project is the same as the source project. This
could be a problem, but it can be easily updated in the project settings and/or
in the server editor (module tab).
However, even the module name is the same, while it's usually equal to the
project name. So, in Project2/.settings/org.eclipse.wst.common.component I find
the following:
This causes problems when deploying modules to the server. Moreover, the module
name can't be easily changed through the GUI from anywhere.
EXPECTED BEHAVIOUR:
The copy&paste operation should update the web module name to "Project2", just
like it happens when you rename a project.
WORKAROUND:
Make sure the module corresponding to the target project has not been added to
the server. Then, manually edit
Project2/.settings/org.eclipse.wst.common.component and change the deploy-name
attribute value of the wb-module element. Close and restart Eclipse (!!!) and
the new name will be taken. If you don't restart Eclipse, even if you edit
org.eclipse.wst.common.component from within Eclipse, WTP does not take the
change (it seems it's caching it somewhere in memory...).

ColdFusion Builder throwing an error about my open project

I am trying to open Adobe ColdFusion Builder, and it is throwing the following error:
"open project has encountered a problem"
Problems occurred opening the selected resources.
The project description file (.project) for 'dev - work' is missing.
This file contains important information about the project.
The project will not function properly until this file is restored.
How do I solve this issue?
What about ovbious steps? It looks like you accidentally deleted the Eclipse project configuration file.
Check if ''.project'' file exists in project directory. If it is missing, re-creating the project and copying the source files from the old is the way to fix it.
Also you can try to create project with same name and copy the ''.project'' file to the old one. Bu you'll need to remove this invalid project first (without deleting the source files) and import it later, because Eclipse (FBuilder) wont allow you to have two projects with same name in workspace.
if you are using developing on windows 7 platform, go to you workspace folder(not where you project is located) right click go to restore select an earlier version. it worked for me