Link to home
Start Free TrialLog in
Avatar of Judy Deo
Judy DeoFlag for United States of America

asked on

compiling .java file into .class file

ok i downloaded the java development kit (JDK) from the SUN website which included the Java Runtime Environment (JRE).

all i am looking to do is compile a .java file i have into a .class file. is there some site (which uses the latest version of the compiler) that will let you submit the .java file and spit back a .class file?  
Avatar of girionis
girionis
Flag of Greece image

 All you need to do is to use the javac command to do it. If you have a program called MyApplication.java you need to do: javac MyApplication.java and this will give you the MyApplication.class file which you can run by doing a: java MyApplication

  Hope it helps.
Avatar of mgaurav
mgaurav

look at the directory where you installed the java.

 make sure that the directory "JAVA_INSTALL_DIR/bin" is in your path.

 make sure that the file "JAVA_INSTALL_DIR/jre/lib/rt.jar" and "JAVA_INSTALL_DIR/lib/something.jar" (i don't recall right now which one) are in the CLASSPATH.

On Windows:
 set CLASSPATH=path_to_rt.jar;path_to_something.jar

On Linux:

  export CLASSPATH=path1:path2


  If it fails, post here the configuration of your JDK installation (OS, path of installation etc)


HIH,
mGaurav
ASKER CERTIFIED SOLUTION
Avatar of s_lavie
s_lavie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Judy Deo

ASKER

why doesn't the JDK automatically create these settings when it installs? also is there a visual studio version for Java (i.e like microsoft's Visual Studio) created by SUN or some other company?
quick question about experts exchange. why doesn't it let you assign partial points? i am going to give the points to "s_lavie" because the link he provided was for an excellent tutorial but "mgaurav" also gave a good answer.
 
There are plenty.
MS has the VJ++
Borland has the JBuilder
And many more...

There is one for free: http://www.netbeans.org/
led me to the perfect tutorial. very good answer.
Thanks!