Results 1 to 6 of 6
Thread: Source Not Found compiling error
- 09-02-2012, 06:06 PM #1
Member
- Join Date
- Sep 2012
- Posts
- 3
- Rep Power
- 0
Source Not Found compiling error
Hey all,
I'm starting college as a CS major soon so I figured it may not be a bad idea to try a quick review program in java to try to be a little less rusty. For my compiler I'm using eclipse which I am fairly confident is commonly used and understood so here's where my question comes through. Essentially the program is pretty basic, it pops up a window with a JButton and when the button is pressed it opens an optionPane that outputs a randomly generated sentence. My issue is whenever I press the button I get a "Source not found" compiling error that goes something along the lines of: "The source attachment does not contain the source for the file EventDispatchThread.class. You can change the source attachment by clicking change attached source below:"
I'll post the actionHandler part of the code and any more upon request. Does anyone know how to fix this?
(P.S. I have no idea if the OS is going to come into play here but if it does this is an Ubuntu laptop)
Java Code:private class actionHandler implements ActionListener{ public void actionPerformed(ActionEvent event){ String message = output.words(); //the randomly generated words to make the sentence JOptionPane.showMessageDialog(null, String.format(message, event.getActionCommand())); } }
-
Re: Source Not Found compiling error
Please show the actual error message. Are you sure that it's a "compiler" message and not an exception, since it appears to be showing up at run time not at compile time.
- 09-02-2012, 06:11 PM #3
Re: Source Not Found compiling error
Please post the full text of the error message.
Are there any error messages from the compiler when you compile the program? Your description of the problem sounds like it happens when you are trying to execute the program, not when you are compiling it.If you don't understand my response, don't ignore it, ask a question.
- 09-02-2012, 11:42 PM #4
Member
- Join Date
- Sep 2012
- Posts
- 3
- Rep Power
- 0
Re: Source Not Found compiling error
Okay... yeah... I may or not be a little bit stupid. Its been a while since I learned what little I know.
Anyway, as it turned out I was just too stupid to scroll up in the errors and its actually a Null Pointer Exception:
"Exception in thread "main" java.lang.NullPointerException
at gui.<init>(gui.java:25)
at slander.main(slander.java:7)" (The programs called "Slander" because it makes random sentences about people that tend to be slander...)
for the record: gui line 25 assigns a random number value to an array that is later used in switch blocks to assign them with the proper word per value.
" for (int x = 0; x<3; x++){
numbers[x] = 1+rand.nextInt(5);
}"
(I figure "rand" is self explanatory...)
and then the line from the main class is just creating the object from the other class.
-
Re: Source Not Found compiling error
So.... you've fixed your problem?
- 09-03-2012, 12:08 AM #6
Member
- Join Date
- Sep 2012
- Posts
- 3
- Rep Power
- 0
Similar Threads
-
Source not found error even after including it
By nehatomar in forum EclipseReplies: 0Last Post: 06-03-2012, 11:10 PM -
Can run, but unable to debug. Having 'Source not found' error.
By ko_aung in forum EclipseReplies: 4Last Post: 04-23-2010, 05:51 PM -
Jsp source not found
By jadeite100 in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 01-17-2010, 01:35 AM -
Error in compiling Firewall source code
By ajib85 in forum NetworkingReplies: 8Last Post: 10-02-2008, 04:37 AM -
Strange error message "Source not found"
By ppayal in forum EclipseReplies: 0Last Post: 11-25-2007, 06:19 PM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks