![]() |
|
[Java] Self Coded Program run errors - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Java] Self Coded Program run errors (/showthread.php?tid=4379082) Pages: Pages
1
2
|
Self Coded Program run errors - YellowMilk - Aug 5, 2014 I'm having trouble running the programs I made on computers. It works fine on the computer I coded it on but when I transfer to a friend or a computer in my house i get the error " a java exception has occurred". The code run fine in debug and run in eclipse and on own computer. * - MrOrang - Aug 5, 2014 Does your friend have Java installed? * - YellowMilk - Aug 5, 2014 (Aug 5, 2014 10:19 AM)lucamasira Wrote: Does your friend have Java installed? Yes, also all my computer have the latest version of java on them So does anyone have a solution that might help me...? * - Deal™ - Aug 5, 2014 Does it print a stack trace, and if so can you provide it? Or does it literally just say "a java exception has occurred"? * - Pumpkins - Aug 6, 2014 You might be getting an IO exception or something because you're accessing a file on your machine which isn't on your friends PC. Read over your project and pin-point the issue. * - YellowMilk - Aug 6, 2014 (Aug 6, 2014 04:53 AM)Zakary Wrote: You might be getting an IO exception or something because you're accessing a file on your machine which isn't on your friends PC. Read over your project and pin-point the issue. I re-read the program and I found no issue. The image is in the package so that might not be the problem. This is the program is use for staffs on my minecraft server to create a text doc to send to me when they report someone but nobody can get it to work. This is my code: Code import java.awt.EventQueue;If you can find the error please help me... * - RuffledUp - Aug 6, 2014 Can you post a stack trace of the error log please? * - YellowMilk - Aug 6, 2014 (Aug 6, 2014 08:50 AM)RuffledUp Wrote: Can you post a stack trace of the error log please? The thing is there isn't a stack trace of the error. That's why I'm so confused. (Aug 5, 2014 07:41 PM)r0llingthund3r Wrote: Does it print a stack trace, and if so can you provide it? Or does it literally just say "a java exception has occurred"?it just flat out say "a java exception has occurred" * - Pumpkins - Aug 6, 2014 Have you tried getting the class resource as a stream? * - YellowMilk - Aug 6, 2014 (Aug 6, 2014 10:24 AM)Zakary Wrote: Have you tried getting the class resource as a stream? Can you explain how I might go at doing that? * - Psifour - Aug 6, 2014 If you are feeling lazy just wrap the questionable parts in a try block and print a stack trace. This will let you quickly pinpoint your issue. At a glance I would guess that the image is not being found in the package and you only tested in your IDE (where the file reference is slightly different). That may not be the case, but that would be my first guess. * - RuffledUp - Aug 6, 2014 (Aug 6, 2014 08:52 AM)YellowMilk Wrote: The thing is there isn't a stack trace of the error. That's why I'm so confused. Of course there is 😶 I dont mean just the console error. Again POST IT HERE as there is more information provided other than "a java exception has occurred". Stop being lazy Is the error happening at compile or runtime? * - YellowMilk - Aug 6, 2014 (Aug 6, 2014 10:57 AM)RuffledUp Wrote: Of course there is 😶 I dont mean just the console error. Again POST IT HERE as there is more information provided other than "a java exception has occurred". Stop being lazy http://prntscr.com/4a6umh: ran in eclipse with console and debug http://prntscr.com/4a6v9w: ran on computer with no eclipse http://prntscr.com/4a6w6j: ran on laptop no error except "a java exception has occurred" on my laptop and other computers. And I'm not being lazy thank you very much. I'm trying to provide as much information as I can. * - Ben121 - Aug 6, 2014 By the looks of it, it isn't an exception in the program but a problem is happening with the running of it. What JDK are you using to compile it with and what JRE are you running on your laptop. Also are you able to use the command line to launch the jar? * - YellowMilk - Aug 6, 2014 (Aug 6, 2014 11:22 AM)Ben121 Wrote: By the looks of it, it isn't an exception in the program but a problem is happening with the running of it. What JDK are you using to compile it with and what JRE are you running on your laptop. Also are you able to use the command line to launch the jar? Im compiling on jdk1.8.0_05 and my jre is 1.8 update 11 on my laptop. My laptop was updated yesterday and before I posted this question :/ Edit: I'll just redo the programs in C++ and see if that's better. Thanks everyone for trying to help. |