-
Something really weird is going on with my code at times.
Sometimes my code doesn't work...usually when it gets kinda big...but I've tried moving it to others projects, other packages, giving it other names...and it either will just compile at a certain point and ignore any additions..good or bad. I can even delete the entire code pretty much and it'll still run at that point. Other times it pretends like it can't find the class or can't find the main method. This is happening to more than one program. I'm getting pretty ticked. Is there a way I can make Eclipse...which I fear may be the culprit behind all of this somehow...behave so I don't have to waste all this memory...in vain too...to compile code?
:(#-o~X(~X(~X(:-ob-(b-(=((:-??:((:-Lx-(x-(
Do you know of any compiler exorcists because I'm starting to wonder if my compiler is possessed? :))
Sorry I can't explain better, but I really don't know what the heck is going on myself.
-
Re: Something really weird is going on with my code at times.
Quote:
Originally Posted by
javapenguin
Sometimes my code doesn't work...usually when it gets kinda big...but I've tried moving it to others projects, other packages, giving it other names...and it either will just compile at a certain point and ignore any additions..good or bad. I can even delete the entire code pretty much and it'll still run at that point. Other times it pretends like it can't find the class or can't find the main method. This is happening to more than one program. I'm getting pretty ticked. Is there a way I can make Eclipse...which I fear may be the culprit behind all of this somehow...behave so I don't have to waste all this memory...in vain too...to compile code?
:(#-o~X(~X(~X(:-ob-(b-(=((:-??:((:-Lx-(x-(
Do you know of any compiler exorcists because I'm starting to wonder if my compiler is possessed? :))
Sorry I can't explain better, but I really don't know what the heck is going on myself.
Maybe back up you code then reinstall eclipse? Have you tried that yet?
-
Re: Something really weird is going on with my code at times.
I have used Eclipse my entire Java programming life and have never once had a problem like this. Have you tried another IDE to see if you have the same issues?
If you do, I suggest completely removing Java from your system and then reinstalling everything including Eclipse.
-
Re: Something really weird is going on with my code at times.
-
Re: Something really weird is going on with my code at times.
Eclipse was doing weird stuff like that to me. So I switched to Netbeans.
-
Re: Something really weird is going on with my code at times.
Quote:
Originally Posted by
JavaPF
I have used Eclipse my entire Java programming life and have never once had a problem like this. Have you tried another IDE to see if you have the same issues?
If you do, I suggest completely removing Java from your system and then reinstalling everything including Eclipse.
I'm wondering if it's the project type I'm selecting. Is there some setting that will cause it to halt in memory or something if it reaches like 1000+ lines in code? If so...how do I stop that?
I haven't tried using a separate workstation...I'd have to move several classes to do that...which wastes memory.
I'm wondering if it's the type of project. Does Eclipse automatically install new IDEs when they come out for me or do I have to go and do that?
Will my code transfer to a new IDE?
-
Re: Something really weird is going on with my code at times.
Hmmmm....I did some tests and when I fiddle with "Run Configurations" and "Debug Configurations", I get different results...which is a breakthrough...but I can't yet get it to do to the updated stuff...it' still won't compile the code that's there. :-?:-?
Could you tell me how to use those configurations correctly so maybe this problem will go away?
^:)^^:)^[-O<[-O<[-O<[-O<[-O<[-O<[-O<[-O<
-
Re: Something really weird is going on with my code at times.
Quote:
Originally Posted by
javapenguin
I'm wondering if it's the project type I'm selecting. Is there some setting that will cause it to halt in memory or something if it reaches like 1000+ lines in code? If so...how do I stop that?
I haven't tried using a separate workstation...I'd have to move several classes to do that...which wastes memory.
I'm wondering if it's the type of project. Does Eclipse automatically install new IDEs when they come out for me or do I have to go and do that?
Will my code transfer to a new IDE?
Your code will transfer to a new IDE.
-
Re: Something really weird is going on with my code at times.
I've been using Ecplise for years and only on one or two occasions have had issues. It has been rock solid for me considering what I've put it through. Three suggestions.
First, go to Project -> clean. I've had problems where it seemed a class file in the project somehow gets corrupted and throws the who project out of wack. Cleaning removes all the compiled files and you can recompile the project from scratch.
Next, if the Project -> Build Automatically is not set then changes will not take effect until you manually build the project.
Lastly, if you have multiple mains in a project, make sure you are running the correct one.
-
Re: Something really weird is going on with my code at times.
Quote:
Originally Posted by
copeg
I've been using Ecplise for years and only on one or two occasions have had issues. It has been rock solid for me considering what I've put it through. Three suggestions.
First, go to Project -> clean. I've had problems where it seemed a class file in the project somehow gets corrupted and throws the who project out of wack. Cleaning removes all the compiled files and you can recompile the project from scratch.
Next, if the Project -> Build Automatically is not set then changes will not take effect until you manually build the project.
Lastly, if you have multiple mains in a project, make sure you are running the correct one.
Now it appears to be doing it for pretty much all of my programs. =((
I was fiddling around with run configurations to see if that would fix it. Now I think I may have just made it worse. b-(
-
Re: Something really weird is going on with my code at times.
Quote:
Originally Posted by
javapenguin
Now it appears to be doing it for pretty much all of my programs. =((
I was fiddling around with run configurations to see if that would fix it. Now I think I may have just made it worse. b-(
Is this the point where we start going in circles? Did you try anything I suggested?
-
Re: Something really weird is going on with my code at times.
If I hit clean, does it just reload or fix the stuff or does it delete it all? I\'m going to try it anyway.
I think I have backups somewhere anyway for some of these.
Ok. Have hit "clean".
Still not quite working. How do you make sure it runs the correct main?
java.lang.NoClassDefFoundError: McWoo/TheList
Caused by: java.lang.ClassNotFoundException: McWoo.TheList
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Exception in thread "main"
:-??:(:(#-o
-
Re: Something really weird is going on with my code at times.
-
Re: Something really weird is going on with my code at times.
Quote:
If I hit clean, does it just reload or fix the stuff or does it delete it all?
There is a reason why there is a extremely comprehensive help menu in Eclipse, and google is a powerful tool. At this stage of the game you really need to use the information that is right in front of you - you are in a much better position to solve a vague problem such as this than any of us. Problem solving is one of the most important processes of programming, and if you can\'t even problem solve your IDE then perhaps you should switch to another.
-
Re: Something really weird is going on with my code at times.
Quote:
Originally Posted by
copeg
There is a reason why there is a extremely comprehensive help menu in Eclipse, and google is a powerful tool. At this stage of the game you really need to use the information that is right in front of you - you are in a much better position to solve a vague problem such as this than any of us. Problem solving is one of the most important processes of programming, and if you can't even problem solve your IDE then perhaps you should switch to another.
I've narrowed down what probably is the matter.
I'm thinking that there's some combination of me screwing up the run configurations and also it doesn't know what to do when I have a package or project with more than one main.
1.) Does my JSE environment matter as I usually just pick the default one?
2.) I have "Create separate Folder for sources and class files" selected.
3.) I have "use default location" checked
4.) Don't know what that stuff that comes up is...but when I compile for the first time...it usually shows a bunch of info that is not code. Have to get to my own computer to show example.
5.) How do you fix Run Configurations to right spot? Is there a way to reset the configuration? If so, where is it and how do I use it?
6.) How do you tell a java class that's in a package that has more than one main to use the main in THAT class and not one of the other mains?
-
Re: Something really weird is going on with my code at times.
Apparently hitting "Clean" seems to have deleted that entire project...which was quite extensive.
That's not quite what I had in mind.
:eek::eek::eek:
I think all the code is there still...it's just acting like it can't run it.
All is not lost. What do I do to ensure it runs the right main?
Also, what should I do with Run Configurations?
Do I alter anything there if there is more than one type or main?
-
Re: Something really weird is going on with my code at times.
Quote:
Apparently hitting "Clean" seems to have deleted that entire project...which was quite extensive.
I presume you did not again take my advice once again re check the build status, read the help, etc... Sigh...going in circles, advice falling on deaf ears, yada yada yada...BTW, clean does no such thing. It removes the built portion of your project. If your source is gone you did something completely wrong (not only with Eclipse, but most importantly not backing it up). At the risk of once more wasting my time to have my advice ignored again, go to run->run configurations and specify the main class you wish to use. You must have a built project however to run it.
-
Re: Something really weird is going on with my code at times.
Quote:
Originally Posted by
copeg
I presume you did not again take my advice once again re check the build status, read the help, etc... Sigh...going in circles, advice falling on deaf ears, yada yada yada...BTW, clean does no such thing. It removes the built portion of your project. If your source is gone you did something completely wrong (not only with Eclipse, but most importantly not backing it up). At the risk of once more wasting my time to have my advice ignored again, go to run->run configurations and specify the main class you wish to use. You must have a built project however to run it.
Build automatically has always been checked.
No, I didn't lose the code.
I have tried that several times..but the compiler seems to have what I'm telling it fall on deaf ears.
-
Re: Something really weird is going on with my code at times.
run->run configurations and specify the main class you wish to use.
-
Re: Something really weird is going on with my code at times.
I've specified the right one by now! I know it. But it's still not working!
I've tried that Run Configuration thing several times before it was even really suggested that much.
^:)^:((~X(~X(~X(~X(~X(
Says it can't find main type! Do I have to rewrite the computer's circuitry, which I don't know how to, to make it work?
-
Re: Something really weird is going on with my code at times.
Could you post a screen-shot of the run-configurations you're using?
Also, have you checked that your source code is correct (there is indeed a main method, it's declared public and static and has a string[] parameter, the package declarations are correct, and the bin folder has the matching folder structure)?
Have you tried running the compiled classes from the command-line? Did it work? If not, what did it tell you didn't work?
The easiest way to fix a run configuration is to simply delete it and re-create the run configuration.
You may want to try creating a new project and importing the source files only via eclipse's import tool (copy/paste might work, but I've had issues with it in the past).
If all else fails, try creating a new workspace with a new project and import the source files.
-
1 Attachment(s)
Re: Something really weird is going on with my code at times.
I've tried reconfiguring the Run Configurations. However, I don't know how to delete them.
java.lang.NoClassDefFoundError: mainBibleProgram/Bible2
Caused by: java.lang.ClassNotFoundException: mainBibleProgram.Bible2
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Exception in thread "main"
I'm wondering now if it's external configurations. I found that it had listed as the location and the working directory a project directory or at least a package directory, if not both, other than the one I had hoped it to be. But it didn't even work on the right one...though it could've been making that same mistake all along.
What should I put for location?
Ok...I tried something but think I have directory and workspace or whatever mixed up or messed up.
Exception occurred executing command line.
Cannot run program "C:\Users\Paul\workspace\WillThisWork\src\mainBibl eProgram\Bible2.java" (in directory "C:\Users\Paul\workspace\WillThisWork\src"): CreateProcess error=193, %1 is not a valid Win32 application
-
Re: Something really weird is going on with my code at times.
To delete and re-create a run configuration:
1. Open up the run-configurations window.
2. Navigate to "Java Applications">your application's run configurations
3. Click on the little red x above the run configuration's search bar
4. Close the run configurations window
5. Open up the class with the main method inside of it.
6. Choose "Run as">"Java Application"
-
Re: Something really weird is going on with my code at times.
Here's an error message that might explain things.
Can't quite figure out how to fix it at the moment.
Cannot run program "C:\Users\Paul\workspace\WillThisWork\src\mainBibl eProgram\Bible2.java" (in directory "C:\Users\Paul\workspace\WillThisWork\src\mainBibl eProgram"): CreateProcess error=193, %1 is not a valid Win32 application
-
Re: Something really weird is going on with my code at times.