Solved

compiling .java file into .class file

Posted on 2002-07-15
8
174 Views
Last Modified: 2013-11-23
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?  
0
Comment
Question by:sagardeo
8 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 7155831
 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.
0
 
LVL 2

Expert Comment

by:mgaurav
ID: 7156298
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
0
 
LVL 2

Accepted Solution

by:
s_lavie earned 500 total points
ID: 7156655
0
 

Author Comment

by:sagardeo
ID: 7157080
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?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:sagardeo
ID: 7157091
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.
 
0
 
LVL 2

Expert Comment

by:s_lavie
ID: 7157095
There are plenty.
MS has the VJ++
Borland has the JBuilder
And many more...

There is one for free: http://www.netbeans.org/
0
 

Author Comment

by:sagardeo
ID: 7157099
led me to the perfect tutorial. very good answer.
0
 
LVL 2

Expert Comment

by:s_lavie
ID: 7157106
Thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
JList custom Cell Renderer refresh 15 53
egit plugin on eclipse 8 37
web services creation SOAP vs REST 5 20
object oriented programming comparison 5 54
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
The viewer will learn how to implement Singleton Design Pattern in Java.
This video teaches viewers about errors in exception handling.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now