• Post Reply Bookmark Topic Watch Topic
  • New Topic

execute java on linux  RSS feed

 
Santoshkumar Jeevan Pawar
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please tell me how to execute java file with main method .

is there any difference while executing on windows and linux.
if there please let me know.
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, you're starting to learn java?

Well, there's a few key steps, and I have no idea how deep into the java world you are.

First, you have to download and install the JDK from sun. You can find it all at www.javasoft.com You may have to dig for it.

Then you have to write a Java program that contains a main method.



Then you have to compile the code using the javac utility.

>>javac HelloWorld.java

After that, you run the code using the java utility.

>>java HelloWorld
Hello World

So, that's how you do it, while leaving out all sorts of details and particular. At this level, there is no difference between Linux and Windows.

I have a couple of free multimedia tutorials on running and compiling Java on my website that show you exactly how to download the JDK, and then how to write and run your first Java class. you should check it out.

Cheers!

-Cameron McKenzie
[ November 12, 2006: Message edited by: Cameron W. McKenzie ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!