eclipse - Executing .java in MS Window -


i beginner in java. used eclipse in mac build project output below .class in bin folder of workspace:

  • main.class
  • mianwindow.class
  • paintpanel.class ...

i can exexute jframe appl'n when double-click main.class file in bin of mac pc.

however, when copy stuff in bin folder window pc , tried run below command, failed execute it:

command prompt used:

c:\program files\java\jre6\bin>java c:\temp\bin\main.class 

error msg:

exeception in thread "main" java.land.noclassdeffinderror: c:\temp\bin\main/class ...       not find main class...program exit.  

any step(s) missed when executing program?

one more question java applet... if allow new client's pc run java applet, everytime when there new client, have compile java project on client's pc before can run applet?

you not need specify extension of java application i.e remove .class.

try this: java c:\temp\bin\main

also if have packaged java file have first in package , run. exampleif have declared class as

package com.my.app;  public class main{ } 

then have move class file com/my/app folder , run as

java c:\temp\bin\com.my.app.main 

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -