8 Replies - 726 Views - Last Post: 06 May 2009 - 09:47 AM Rate Topic: -----

#1 saulfenky2470   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 70
  • Joined: 11-December 08

help with compiler and stuff realted

Posted 01 May 2009 - 09:57 AM

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!!!

Is This A Good Question/Topic? 0
  • +

Replies To: help with compiler and stuff realted

#2 nick2price   User is offline

  • D.I.C Lover
  • member icon

Reputation: 565
  • View blog
  • Posts: 2,826
  • Joined: 23-November 07

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
Was This Post Helpful? 0
  • +
  • -

#3 Mikeyp926   User is offline

  • D.I.C Head
  • member icon

Reputation: 29
  • View blog
  • Posts: 205
  • Joined: 20-March 09

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
Was This Post Helpful? 0
  • +
  • -

#4 pbl   User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8381
  • View blog
  • Posts: 31,956
  • Joined: 06-March 08

Re: help with compiler and stuff realted

Posted 01 May 2009 - 08:41 PM

View Postnick2price, 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.
Was This Post Helpful? 0
  • +
  • -

#5 KYA   User is offline

  • Wubba lubba dub dub!
  • member icon

Reputation: 3213
  • View blog
  • Posts: 19,241
  • Joined: 14-September 07

Re: help with compiler and stuff realted

Posted 01 May 2009 - 08:45 PM

View Postpbl, on 1 May, 2009 - 08:41 PM, said:

View Postnick2price, 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!
Was This Post Helpful? 0
  • +
  • -

#6 pbl   User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8381
  • View blog
  • Posts: 31,956
  • Joined: 06-March 08

Re: help with compiler and stuff realted

Posted 01 May 2009 - 08:53 PM

View PostKYA, on 1 May, 2009 - 07:45 PM, said:

View Postpbl, on 1 May, 2009 - 08:41 PM, said:

View Postnick2price, 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
Was This Post Helpful? 0
  • +
  • -

#7 saulfenky2470   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 70
  • Joined: 11-December 08

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
Was This Post Helpful? 0
  • +
  • -

#8 Mikeyp926   User is offline

  • D.I.C Head
  • member icon

Reputation: 29
  • View blog
  • Posts: 205
  • Joined: 20-March 09

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
Was This Post Helpful? 0
  • +
  • -

#9 saulfenky2470   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 70
  • Joined: 11-December 08

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
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1