hey,
ok so ive got the CMD up and i run a java program. Then i see something i want to change. So i open up NotePad, and change it, then save it as a .JAVA file.
when i look at the files in my folder i have a .JAVA and a .CLASS.
i know when you compile a .JAVA file you get a .CLASS file
my question is, do i have to recompile the .JAVA program if i changed something, haveing a .CLASS file already?
would it just change the .CLASS file too?
and if i do wouldnt that make TWO .CLASS files?
please help!!!
help with compiler and stuff realted
Page 1 of 18 Replies - 726 Views - Last Post: 06 May 2009 - 09:47 AM
Replies To: help with compiler and stuff realted
#2
Re: help with compiler and stuff realted
Posted 01 May 2009 - 10:13 AM
everytime you compile somthing with changes in it, a new .class file will be created. Sometimes you can have a folder with several different .class files for one class, but it will use the current version .class file. There is no harm though, if getting too cluttered with .class files, to go into your folder, delete all the .class files, and then recompile your java file. Then it will just leave you with the one .class file for the current .java file
#3
Re: help with compiler and stuff realted
Posted 01 May 2009 - 12:22 PM
Also, in my experience the new .class file usually just overwrites the old one, so when you do recompile your code, you'll probably end up with just one .class file, but it will be the most up to date one.
-Michael
-Michael
#4
Re: help with compiler and stuff realted
Posted 01 May 2009 - 08:41 PM
nick2price, on 1 May, 2009 - 09:13 AM, said:
everytime you compile somthing with changes in it, a new .class file will be created. Sometimes you can have a folder with several different .class files for one class, but it will use the current version .class file. There is no harm though, if getting too cluttered with .class files, to go into your folder, delete all the .class files, and then recompile your java file. Then it will just leave you with the one .class file for the current .java file
You must be working on OpenVMS. It is the only OS I know that keeps different versions of the same file name.
#5
Re: help with compiler and stuff realted
Posted 01 May 2009 - 08:45 PM
pbl, on 1 May, 2009 - 08:41 PM, said:
nick2price, on 1 May, 2009 - 09:13 AM, said:
everytime you compile somthing with changes in it, a new .class file will be created. Sometimes you can have a folder with several different .class files for one class, but it will use the current version .class file. There is no harm though, if getting too cluttered with .class files, to go into your folder, delete all the .class files, and then recompile your java file. Then it will just leave you with the one .class file for the current .java file
You must be working on OpenVMS. It is the only OS I know that keeps different versions of the same file name.
I can't imagine. That must be horrible!
#6
Re: help with compiler and stuff realted
Posted 01 May 2009 - 08:53 PM
KYA, on 1 May, 2009 - 07:45 PM, said:
pbl, on 1 May, 2009 - 08:41 PM, said:
nick2price, on 1 May, 2009 - 09:13 AM, said:
everytime you compile somthing with changes in it, a new .class file will be created. Sometimes you can have a folder with several different .class files for one class, but it will use the current version .class file. There is no harm though, if getting too cluttered with .class files, to go into your folder, delete all the .class files, and then recompile your java file. Then it will just leave you with the one .class file for the current .java file
You must be working on OpenVMS. It is the only OS I know that keeps different versions of the same file name.
I can't imagine. That must be horrible!
Not at all... there is a revision number after each filename
a.java;1
a.java;2
a.java;3
you can always go back and re-open a.java;1 if you did something wrong in your edit
there is a purge command that deletes the older version
> purge
would delete a.java;1 and a.java;2
> purge/keep=2
would delete a.java;1 only
#7
Re: help with compiler and stuff realted
Posted 04 May 2009 - 09:44 AM
so how can i tell if i am useing a VMS
#8
Re: help with compiler and stuff realted
Posted 04 May 2009 - 01:29 PM
I think if you were using a VMS you would probably know about it, lol.
If you only ever see one .class file for each .java file then just assume you are not using a VMS. When you use the cmd and do your javac and java commands it will automatically run the most up to date version of your program. That's all you need to worry about. :-)
-Michael
If you only ever see one .class file for each .java file then just assume you are not using a VMS. When you use the cmd and do your javac and java commands it will automatically run the most up to date version of your program. That's all you need to worry about. :-)
-Michael
#9
Re: help with compiler and stuff realted
Posted 06 May 2009 - 09:47 AM
ok this is weird
yesterday i was compiling like no bodys buniess.
but today when i type in
javac BeatBox.java
which should complie me code it says...
' javac' is not recognized as an interal or exteral command, operable program or batch file.
WTF????
it was working yesterday
yesterday i was compiling like no bodys buniess.
but today when i type in
javac BeatBox.java
which should complie me code it says...
' javac' is not recognized as an interal or exteral command, operable program or batch file.
WTF????
it was working yesterday
Page 1 of 1

New Topic/Question
Reply



MultiQuote





|