Solved

compiling .java file into .class file

Posted on 2002-07-15
8
173 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
Comment Utility
 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
Comment Utility
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
Comment Utility
0
 

Author Comment

by:sagardeo
Comment Utility
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:sagardeo
Comment Utility
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
Comment Utility
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
Comment Utility
led me to the perfect tutorial. very good answer.
0
 
LVL 2

Expert Comment

by:s_lavie
Comment Utility
Thanks!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

763 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

5 Experts available now in Live!

Get 1:1 Help Now