File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

run a java application in Windows

 
Manos Kolias
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody. I'm new in java and in programming languages. I study java for many hours per day but i have a lot of questions. Suppose i create a java application with Eclipse . Then this application after compiling becomes an application.class file.
How can i run this application under my OS (WIndows ?)I dont mean with javac or something like that but generally speaking.I mean for example a desktop application.
Can someone help me on this?
Thanks a lot Manos.
 
Andrew Robinson
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The easiest way is to navigate to the folder the class file is in and then use: java application or you can run it by specifying the absolute path like this: java -classpath c/myPrograms/Program1 application
 
W. Joe Smith
Ranch Hand
Posts: 710
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are new to Java (and all programming languages in general) I would recommend not using Eclipse for a while. An IDE is a great tool, but you should learn the basics of the language before you start using a tool like that. I've heard good things about NotePad++, and if you search you can find quite a few more free development tools.

I think you can create a batch file that you can use to run a java program, basically having it call java ClassToRun.
 
Manos Kolias
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you be a little more specific please?
If for example i make an application like an agenda which holds dates scheduled events etc and i want this application to run under my OS or in someone else's machine how can i "do the connection"?.
 
Paul Clapham
Sheriff
Pie
Posts: 20188
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "do the connection"? As far as how to run an application, what Andrew Robinson said is basically the answer, although you can do it in more complicated ways. And you do need to have a JRE installed on the machine where you plan to run the application.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Manos Kolias wrote:How can i run this application under my OS (WIndows ?)I dont mean with javac or something like that but generally speaking.I mean for example a desktop application.

Have a look at Sun's Java tutorials, they are quite good. You can run Java programs from the command line, as the Hello World tutorial explains in detail. If you don't want a user to have to use the command line, you can put the command to run the application in a Windows batch file, which you can run by just double-clicking the icon. You can also package the complete application in a JAR file, which you can read about in this tutorial (but it's a more advanced topic, I'd save that for later if you're still very new to Java).
 
salvin francis
Bartender
Pie
Posts: 1227
10
Eclipse IDE Google Web Toolkit Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Manos Kolias wrote:Hello everybody. I'm new in java and in programming languages. I study java for many hours per day but i have a lot of questions. Suppose i create a java application with Eclipse . Then this application after compiling becomes an application.class file.
How can i run this application under my OS (WIndows ?)I dont mean with javac or something like that but generally speaking.I mean for example a desktop application.
Can someone help me on this?
Thanks a lot Manos.


You can double click the jar file and it will run just like any exe file in windows.
[Assuming you have java installed]
 
salvin francis
Bartender
Pie
Posts: 1227
10
Eclipse IDE Google Web Toolkit Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
btw here are the settings to allow jar files to run in windows [you mostly dont need to configure this unless some zip application has hijacked the 'jar' extension]:


Tools > Folder Options > File Types > if existing then modify or click new...

File Type: Executable Jar file
Create an action called 'open'
Application used to perform action:
"C:\Program Files\Java\jre1.5.0_05\bin\javaw.exe" -jar "%1" %*
[assuming its in 'C:\Program Files\Java\jre1.5.0_05\bin']
check use DDE
Topic: System

Set 'open' action to default



 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic