Hi everyone, I need to be able to run a Java application (not an applet) directly, that is not from an IDE or the command line. How can this be done for a Windows PC? I have seen many applications written in Java, but are executed just like other Windows apps, so there must be a way.
vicky_dev
12
Junior Poster in Training
Recommended Answers
Jump to PostIn your command line prompt type java myProgram to run a compiled version of a java program called myProgram. You may need to set an environment variable for the path where your java vm is installed. Let us know if you need to know how to do this... :)
Jump to Postjavaw is designed for that (launches the JVM but without a command window) again needs to be in your path. Then create a windows shortcut with the necessary command. See here for more info:
Jump to PostTo compile the code you have to type:
javac myapp.java
it will create a myapp.class file in the same or diff location... then just follow it and type java myapp it will run the code... you have to compile before running... you may have to setup the classpath to include …
Jump to PostOnce you install Java, you should be able to "double-click" on a .class file and execute it in that way, if you don't have a class file (but just a .java file), then you have to compile it/them first. Better would be, to create a jarfile containing the relevant classpath …
Jump to PostBest is to use ANT to build your projects to jar files. (or maven if you want to take it a step further).
Once you know how to do it manually, yes. But just like with using an IDE, you should not start with it. You should first learn how …
All 17 Replies
darkagn
315
Veteran Poster
Featured Poster
hollystyles
113
Veteran Poster
orko
36
Junior Poster
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
schoolsoluction
-1
Light Poster
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
vicky_dev
12
Junior Poster in Training
vicky_dev
12
Junior Poster in Training
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
vicky_dev
12
Junior Poster in Training
orko
36
Junior Poster
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
cms271828
2
Junior Poster
schoolsoluction
-1
Light Poster
vicky_dev
12
Junior Poster in Training
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
vicky_dev
12
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.