This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to compile/run

 
Vincent Hendriks
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Since I recently started learning Java, I'm compiling and running my programs with two batchfiles (because actually working from the command line is not optimal).

I need the compiling batch-file because the window closes so fast after compiling, I can't read the compiler errors (hence the pause!):

@echo off
fileName.java
pause


I need the running batch-file because just double-clicking my class file doesn't work:

@echo off
java fileName
pause


Although this works, it's a bit annoying that I have to change the batch-files everytime I want to compile or run another class...

I'm a bit hesitant though about downloading programming software without knowing what it actually can do...
I don't want to use a big "suite-like" program because the fun for me is not so much in making a big fancy program but in writing the code itself!

Therefore the question: is there another way/a program to do this?
What I could really use is just a code-editor with a compile and a run button and a frame to display compiling- (and yes, I'm a newbie, runtime-) errors (and without fancy extra's, options, etc.)
 
Kevin Workman
Ranch Hand
Posts: 151
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you want to use the command line to compile and run? It really is the best way for newbies to learn.

There are a ton of IDEs out there that do exactly what you just described. Google them, try a few out, and see what you like and don't like.
 
Mohamed Sanaulla
Saloon Keeper
Pie
Posts: 3159
33
Google App Engine Java Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try Notepad++. I had long back written an article on how to compile and run java programs through Notepad++ (it was for simple programs, not the one with packages and all).

There should be some way to pass the class name/source file name as the arguments to the batch file- like we have in a shell script. You could try that.
 
Vincent Hendriks
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK. Good to know that stuff like that is around

I'll try and find something that works for me.

Thanks
 
Campbell Ritchie
Sheriff
Pie
Posts: 47286
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are probably better off at a beginner's stage using the command line directly. Use Notepad++ as a text editor; it is really good for editing program text.
You never double-click a class file to run it.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic