Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

j.drake.hoffman

macrumors newbie
Original poster
Aug 20, 2009
16
0
right here
hello all,

so I have an issue with getting some of my java programs to compile. with certain files that i have already written (and been graded on) and know contain no syntax errors, I am getting a compiler error that appears to mean that I do not have StdIn in the same directory as the java file. I am confused by this bc they most definitely are.

2 important notes: upon starting Dr. Java (sorry, I'm relatively new to java--only one semester under my belt) I get an odd error message--I suspect somehow this is due to an incorrect installation (?). something is not as it should be at least... And second, all of these were written on a windows machine (I'm a recent convert). I'm just confused why the programs that should work don't.

any and all help would be useful! any and all constructive comments are welcome, and please ask questions if it will help.

thank you in advance!

btw, somehow my previous account was gone, so i had to sign up again..... I'm not as new as the info would have me appear.
 

Attachments

  • startup error.png
    startup error.png
    57.6 KB · Views: 152
  • compiler error.png
    compiler error.png
    185 KB · Views: 186
  • java file.png
    java file.png
    315.2 KB · Views: 97
  • StdIn.png
    StdIn.png
    318.4 KB · Views: 127
The error you highlighted in yellow (Class file has version 50, should be 49) means that you compiled the In.java file using java compiler from a later version of JDK and you are now trying to use it when compiling dependent Java files using a previous version of the compiler.

So make sure all java files and class files they depend upon are compiled with same version of the compiler and that error will go away.
 
The error you highlighted in yellow (Class file has version 50, should be 49) means that you compiled the In.java file using java compiler from a later version of JDK and you are now trying to use it when compiling dependent Java files using a previous version of the compiler.

So make sure all java files and class files they depend upon are compiled with same version of the compiler and that error will go away.

I'm slightly confused. are you saying I need to update my JDK, or i need to use an older one?
 
I'm slightly confused. are you saying I need to update my JDK, or i need to use an older one?

Doesn't matter as long as you use one single version of the JDK to compile all your Java files.

So gather all your java files and compile them using whatever latest JDK version is installed on your system.

I don't know the details of your setup but from what I can tell you have some .class files (may be you got them somewhere or compiled them in a different environment) that were compiled with later version of the JDK and you have some of your own java files that depend on those class files which you are compiling using a older version of the JDK.

So if you have the source for all the Java files - just delete all .class files and recompile them on one JDK version. If you only have .class files for few classes then find out which version of JDK was used to compile them and then make sure you use the same version to compile your java sources.
 
you are now officially my personal hero! lol. everything appears to be working perfectly!

should there be any reason to be alarmed by the startup error message?
 
should there be any reason to be alarmed by the startup error message?

Glad to be of help.

That error is DrJava error parsing the configuration file - nothing alarming about it. You can open the configuration file and remove the offending line that it shows in the error dialog OR preferably just ignore it and deal with the minor annoyance.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.