Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Headfirst program doesn't run in cmd


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Jeffige   Members   -  Reputation: 113

Like
0Likes
Like

Posted 11 August 2012 - 08:44 PM

I am following along with HeadFirst java. Got the path(s) correct, checked to make sure java was installed correctly with javac. I created a folder in: C:\Users\JEFFD\headfirst. Changed dir to C:\Users\JEFFD\headfirst. When I try and run javac MyVeryFirstApp.java, the dos window pauses for a half a second and returns with C:\Users\JEFFD\headfirst.


public class MyVeryFirstApp {

public static void main (String [] args) {
	 System.out.println( "I Rule!");
	 System.out.println("The World!");
	  }
}

thanks for any help.

Sponsor:

#2 darookie   Members   -  Reputation: 1437

Like
1Likes
Like

Posted 12 August 2012 - 01:29 AM

That is to be expected. Javac is just the compiler that generates bytecode from your program. You can execute the program using the java command.

#3 !Null   Members   -  Reputation: 380

Like
0Likes
Like

Posted 15 August 2012 - 03:34 AM

Darookie is right, once the compiler has created the jar, if you run a command line from the same folder as the .jar you can use the cmd

java -jar MyVeryFirstApp.jar

that will run the jar from the cmd....or you could just double click it.
/********************************************************************************\
/**********************He Who Dares, Wins**********************************\
/********************************************************************************\




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS