Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > Java Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 15th, 2007, 04:15 PM
Authorized User
 
Join Date: Nov 2005
Location: , , United Kingdom.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to run a java program without any IDE?


How to run a java program without any IDE?

I have edited and debugged a java application program using JBuilder and now I want to make use it. But now I have finished editing and debugging the java application, how do I arrange to open it without opening it through JBuilder or any other IDE? Obviously I do not want JBuilder to open every time I open the application! What I want is to be able to click on an icon and for this alone to cause the application to run. I have located the compiled java program on the hard disk and tried to open it in various ways but the result is always the same: JBuilder always opens first which is not what I want. I would be most grateful for any advice anyone can give me.

                         :)Andrew Hamilton.


Reply With Quote
  #2 (permalink)  
Old January 16th, 2007, 07:43 AM
Authorized User
 
Join Date: Sep 2006
Location: , , .
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default

goto the command prompt and run cheyachukada

Reply With Quote
  #3 (permalink)  
Old January 16th, 2007, 10:14 AM
Authorized User
 
Join Date: Nov 2005
Location: , , United Kingdom.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You will have to excuse my ignorance because I am still very much a learner and I do not know what is meant by a ‘command prompt’. I couldn’t find anything called ’command prompt’ in Jbuilder (nor in any of my java books) although I may be looking in the wrong places. I did a search on all fines and documents on my hard disk drive for ‘chevachukada’ and found nothing. I also did a search on all fines and documents on my hard disk drive for ‘command prompt’ and to my surprise I found such a file at C:\WINDOWS\system32\config\system profile\start menu\programs\Accessories
But I have no idea if this has anything to do with it and, when I opened it, a primitive looking window appeared with some white writing on a black-background which said:

Microsoft Windows XP {Version 5.1.2600}
<C> Copyright 1985-2001 Microsoft Corp.

C:\Documents and Setting\Andrew>

If this is what I require, I have no idea what to do next. Any advice would be greatly appreciated.

                                   Andrew Hamilton



Reply With Quote
  #4 (permalink)  
Old January 18th, 2007, 07:11 AM
Authorized User
Points: 63, Level: 1
Points: 63, Level: 1 Points: 63, Level: 1 Points: 63, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2006
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can run your java application.class from Dos Prompt as follows:

C:\> java [path\]<application>

You can also use Window's Run utility (Command Prompt).
Reply With Quote
  #5 (permalink)  
Old January 18th, 2007, 08:01 AM
Registered User
 
Join Date: Dec 2006
Location: , , India.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

If you have decided not to use any IDE then command prompt is the only option to run your java files.
You are right, "C:\Documents and Setting\Andrew>" is the command prompt window only.
Now if you have the .class files with you then you can directly run them on cmd prompt by
"C:\> java [path\]<application>"
    where "[path]" is the location where your .class file resides and "<application>" is name of the class file that you want to run.

ex. C:\> java examples\Test (Test is the name of your application and examples is the folder in which Test.class resides).

and if you don't have .class file with you, yuo have to complie the .java file as follows
ex. C:\> javac examples\Test.java




Reply With Quote
  #6 (permalink)  
Old January 19th, 2007, 01:52 PM
Authorized User
 
Join Date: Nov 2005
Location: , , United Kingdom.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

Thanks for that. I think I have nearly got it to work! When I enter it in the command prompt and press the enter key the command prompt gives the following error message:

Exception in thread “main” java.lang.NoClassDefFoundError: Documents

I have checked the path and the spellings several times and cannot see what is wrong with it. But this is not what really bothers me because running a program using the command prompt is not really what my aim is here anyway. I only wanted to do it in the hope of gaining a better understanding of these things.

What I should have said is what I really want is to make an application program written in java that I can sell over the net. A client must be able to download my application over the net to their desktop and when they double click the icon for it, just like when you double click any icon on your desktop, this automatically causes the application to open and run. Obviously, when a client doubles clicks the icon, I don’t want any IDE to open nor do I want the client to have to run it by explicitly using any ‘command prompt’. I have heard that many applications sold over the internet are written in java (compiled to byte-code), so surely it is possible to arrange to set one of my applications written in java to automatically run in response to its icon on the desktop being double clicked and without any IDE or command prompt, isn’t it? If any one can tell me how to do this I would be most grateful.

                    :)Andrew Hamilton

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HOW to Run php program dimpleboy PHP How-To 7 January 22nd, 2015 12:40 AM
Java IDE The Beginner Java Basics 3 March 8th, 2007 07:47 PM
Run Program outside IDE (please help a begginer) aepstein824 C++ Programming 1 February 27th, 2006 09:28 PM
best JAVA IDE to use pilmart Java GUI 4 June 6th, 2004 12:05 AM



All times are GMT -4. The time now is 12:30 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.