compile and run java program

compile and run java program

Hello, everyone!!!

I just want to ask if you anyone here knows how to compile java file in linux specifically UBUNTU.

For example, I have a java file named Hello.java and saved at my desktop.

how do I compile and run this file using the terminal of ubuntu...

By the way, I am using the java built-in compiler of UBUNTU..

I hope you could help me with this one...

YOUR HELP IS HIGHLY APPRECIATED...

View Answers

March 11, 2013 at 2:04 PM

Hi,

View the video tutorial at Compiling and Running Java program from command line.

Thanks


March 10, 2012 at 9:11 PM

1.Get the terminal first then create directry inside your home directry by typing the command: mkdir directryname. 2. After that go inside that folder and open PICO editor in your terminal. You can do it by just typing command: pico 3. Then copy and paste your java code onto that editor view.Then type command: CTRL-X.When you give that it will ask about saving the code save it as your program name.java.It will return you to usual terminal view. 4. Now you can enter the command for compiling the source code : javac your program name.java 5. After that you can run your program by the command: java your program name









Related Tutorials/Questions & Answers:
compile and run java program
compile and run java program  Hello, everyone!!! I just want to ask if you anyone here knows how to compile java file in linux specifically UBUNTU..._TO_REPLACE_1 how do I compile and run this file using the terminal of ubuntu
How to compile and run Java program
How to compile and run Java program  How to compile and Java program..., For compiling and running the Java program from command prompt you should must have JDK... tutorial Compiling and Running Java program from command line. If Java
Advertisements
how to compile and run servlet program
how to compile and run servlet program   hello sir/mam i hve installed tomcat5.5 version and also have jdk1.6.0_14 installed but not able to run it or compile i m doing it first tyme pls help me in sorting out this problem. i hve
How to Develop, Compile & Run a rmi Program in NetBeans 6.9.1 ide?
How to Develop, Compile & Run a rmi Program in NetBeans 6.9.1 ide?  how to develop, compile & run a rmi program in netbeans 6.9.1 ide? will you please give me a step by step (practical) explaination? Thanks in advance
how to run java program
how to run java program  i have jar file. in jar i have so many classes.in one of file i want modify .after modifying file i want replce in jar. please help me to how to generate class and how to replace
How to compile and run the JSP
How to compile and run the JSP  Hi Kindly tell me how to run and compile JSP small Program using Tomcat as webserver. I created small program HELLO JSP in HTML and compile the program but it is saying Class o r interface
java program run on thml page?
java program run on thml page?  how to run java program on html page using text area
Example to compile a java file with the help of the program
Example to compile a java file with the help of the program... are describing you the way to compile the java file with the help of the java program. The steps involved for compiling the java file from the program are described
how to run a java program using run.exec()?
how to run a java program using run.exec()?  Hi..i want to compile and run a java file using run.exec().i.e., without compiling and running from command prompt i want to do them in the program itself.I am able to compile
why java program not run with msword editor
why java program not run with msword editor  if java program write in MICROSOFT WORD then why they are not run with jdk
How to Run First Java Bean Program ?
How to Run First Java Bean Program ?  Hi My Dear Friend I can run many Java Programs Like, Applet,Swing,RMI ,Socket Programming and Java Servlet too But Now I need that How to run Java Bean Now I have BDK1.1 But still don't
how to compile and run struts application - Struts
how to compile and run struts application  how to compile and run struts program(ex :actionform,actionclass) from command line or in editplus 3
How to run a Java program in CMD
discussed how to write and run Java program in CMD. Tips to run Java program...\Java\jdk1.5.0_09\bin Now time to compile your program. Write the following... the program. Run the given command. C:\myproject> java HelloWorldADS_TO_REPLACE_2
how to run this program?
how to run this program?  how to run java swing program   Java Swing program runs same as a simple java program. There is no difference... with javac and run with java command, same as a simple java program. Learn Swing
how to run rmi program
how to run rmi program  how to run rmi program
couldnt run this program
couldnt run this program  package calculator; import java.util.Scanner; public class calculator{ public static void main(String args[]){ Scanner vin = new Scanner(System.in); Double firstnum,secondnum,sum,sub,mul
compile this program and let me know the resolution
compile this program and let me know the resolution  class Maxof2...+" is greater than "+i); } } please compile and let me know the resolution  ... arguments like this: java Maxof2 4 5 The code take these values and check
i got an error while compile this program manually.
i got an error while compile this program manually.  import javax.servlet.http.*; import org.apache.struts.action.*; public class ActionOne{ public ActionForward execute(ActionMapping mapping
How Jdbc program can be run??
How Jdbc program can be run??  import java.sql.*; import java.util.... = window.adsbygoogle || []).push({}); C:\Program Files\Java\jdk1.5.0\bin>java... created successfully and when i compiled this program then it compiled successfully
How to run JSP program inEclipse?
How to run JSP program inEclipse?  Hi, I am learning JSP. I want to run JSP in Eclipse. How to run JSP program inEclipse? Thanks   Hi, Its easy to run JSP from the Eclipse. You have to make a dynamic web application
compile
compile  how to compile a java program using jre7
compile a java class
compile a java class  Hi, Am having a class ExampleOne.java in the location C:\learn\ExampleOne.java I want the class file to be present in C:\. I don't want to add any package details in the code. Is is possible to get
compile a java class
compile a java class  Hi, Am having a class ExampleOne.java in the location C:\learn\ExampleOne.java I want the class file to be present in C:\. I don't want to add any package details in the code. Is is possible to get
JAVA Compile Question ?
JAVA Compile Question ?  I'm unable to compile this file and not sure why? Can someone please help? import java.nio.file.*; import java.nio.file.attribute.*; import java.nio.file.attribute.Attributes; import
Compile error - Java Beginners
Compile error  I get this error when compiling my program: java:167: unreported exception java.lang.Exception; must be caught or declared.... Thanks  Hi friend, Do some changes in the code then compile Successfully
servlet not compile - Java Beginners
servlet not compile  Hi friend, I am Using JDK 5.0 with that javax.servlet is not available so i download this package and put it in the src folder,but my program displayed "package not found" at the time of compilation
compile
compile  how to compile .class files using eclipse
how to run jdbc program in linux-ubuntu?
to compile java program javac prog.java java prog...how to run jdbc program in linux-ubuntu?  how to run jdbc program in linux-ubuntu?   hi firstly download the jdk on your system using
how to run java program that has several classes under package from usb drive?
how to run java program that has several classes under package from usb drive... package. I have to use following line on command line to compile and run my program... command line and it works. I copied all java files and class files to flash drive
How to run program in new opened cmd
How to run program in new opened cmd  Hello i have made a program in java to open command prompt, then how to run my left of the program in the new opened command prompt
How to Program in Java
the program. This is the final step of testing the Java program. Here it will run...This tutorial tells you how to program in Java? As a beginner you must know... is also used to create enterprise web applications also. To program in Java you
how to run jdbc program in linux-ubuntu?
how to run jdbc program in linux-ubuntu?   how to run jdbc program in linux-ubuntu
how to run jdbc in jsp program - JSP-Servlet
how to run jdbc in jsp program  i want to use sql server 2005 in jsp program to store data.i know how to run simple program but this program i tried my best i am not able to do so.please give me the answer of this as soon
Download and Install Java
;  To compile and run a java program we... set of tools required to compile and run java programs. This section...:\Program Files\ Java\jdk1.6.0_01". Now click on "OK"
run command prompt from jsp program
run command prompt from jsp program  Hi.... Is it possible to run a command prompt from jsp? If possible please help me with some code... Thanks & Regards vanchinathan.R
Java compile error - Java Beginners
Java compile error  I am having trouble compiling the Java project available on this site at http://www.roseindia.net/chatserver/index.shtml... to compile Java on Mac besides using the Terminal
First Java Program
Compile and Test the Program Java provides javac compiler to compile the Java... First Java Program       In this section you will learn how to develop your first Java program
how to run - Java Beginners
how to run   how to run java program... brifely  Hi... the "javac" command to compile the program and after compiling,uses "java" command to execute or run the program. For ex, If you have the following java program
java not run on my pc
java not run on my pc  i have installed java in pc but when i run and compile any program the massage is display that 'javac' is not recognized as an internal or external command
best os to run java
best os to run java  which is best os to run java program
How to run JSP program in Tomcat server step by step?
How to run JSP program in Tomcat server step by step?  Hi, I am.... How to run JSP program in Tomcat server step by step? Thanks   Hi, JSP technologies is used in Java to make dynamic web program that runs
Java compile time error. - Java Beginners
Java compile time error.  CreateProcess error=2, The system cannot..., Please specify in detail and send me code. If you are new java... : http://www.roseindia.net/java/master-java/index.shtml Thanks & Regards
New to JSP..need help to make & run a JSP program.
New to JSP..need help to make & run a JSP program.  Hi, I have installed Tomcat 5.5 on my system. Plz help me to make a simple JSP program. And also how to run it.ADS_TO_REPLACE_1   Hi Friend, Have you set
Find the files that has been modified before run the program
modified a file in the directory and run the program, it can list out the file... and run the program, it can only show the file that has the latest modification time... i run the program?   Sorry. Please help me remove this post
Find the files that has been modified before run the program
in the directory and run the program, it can list out the file that i has been modified. But when i modified more then 1 files in the directory and run...Find the files that has been modified before run the program  Hi. I
Find the files that has been modified before run the program
in the directory and run the program, it can list out the file that i has been modified. But when i modified more then 1 files in the directory and run...Find the files that has been modified before run the program  Hi. I
Java run time polymorphism
Java run time polymorphism  What is run-time polymorphism or dynamic method dispatch
java pages run
java pages run  how do we run jsp file in the browser. do we need to install server. could it be run on the xamp server   You need Apache Tomcat Server to run the jsp code over it. Follow these steps to run the simple
run a java application - Java Beginners
run a java application  Hai Deepak, I ve set my environment...; CLASSPATH= C:\Program Files\Apache Tomcat 4.0\common\lib\servlet.jar; JAVA_HOME=C:\Program Files\Java; path=C:\Program Files\Java\jdk1.6.0_06\bin; My
Hello world (First java program)
. Java application program is platform independent and can be run on any...Hello world (First java program) - Learning to write your first Java program... to compile the HelloWorld.java program. Go to the directory where you have saved

Ads