Solved

compiling .java file into .class file

Posted on 2002-07-15
8
182 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 

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
 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
The viewer will learn how to implement Singleton Design Pattern in Java.

705 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