473,326 Members | 2,655 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

"Compile Java" and "Run Java Application" options in Notepad ++ ?

16
Is it possible to add those options in Notepad ++ ?
Your help would be appreciated very much.
Thanks in advance.
Jul 5 '07 #1
6 20125
r035198x
13,262 8TB
Is it possible to add those options in Notepad ++ ?
Your help would be appreciated very much.
Thanks in advance.
Under the run tab, click "Run ..."

Then in the textbox provided type
javac NameOfJavaFile.java

To run it use the java command.
I hope your console doesn't disappear too quickly as does mine such that everytime when I write scripts in notepad++ I compile them from the windows command prompt .
Jul 5 '07 #2
dmstn
16
Ah, I see. Useful.
But yeah. The DOS window disappeared quickly when I ran the program.
Thanks anyway.
Jul 5 '07 #3
I've found the way to compile & run Java applications from Notepad++ with just one hotkey.
First of all, go to the directory where you have installed Notepad++ and create a new file called CompileJava.bat
then open it and enter these lines (without line numbers):
Expand|Select|Wrap|Line Numbers
  1. @echo off
  2. path=%path%;"<path to your BIN directory of JDK>"
  3. @echo on
  4. javac %1
  5. java %2
  6. pause
  7.  
Save the file and exit.
After that, open Notepad++ and press F5. Fill in the box in the small window that appears with (without line number):
Expand|Select|Wrap|Line Numbers
  1. $(NPP_DIRECTORY)\CompileJava.bat $(FILE_NAME) $(NAME_PART)
  2.  
then press the Save button, give a name to the shortcut and select the hotkey. Press Ok. Now open a java source and press the hotkey you've selected and you will see your program compiling & running!
Mar 12 '08 #4
BigDaddyLH
1,216 Expert 1GB
There are several free editors that can do this and more, for example TextPad:

http://www.textpad.com/

It's a basic editor, but it does syntax coloring of Java and comes with menu items to compile and run Java (CTRL+1 and CTRL+2). One of its other features is that it captures compiler error messages in a window, and clicking on a specific error message causes you to jump to the corresponding line in your source code.
Mar 12 '08 #5
TextPad isn't free. It's shareware ("try before you buy").
Jun 29 '11 #6
Nepomuk
3,112 Expert 2GB
There's an old trick to stop the box closing so that you can read whatever it prints out: Right at the end of the main function add the line
Expand|Select|Wrap|Line Numbers
  1. System.in.read();
That way, it will wait for you to input something before it closes. It's not very aesthetic, I know, but it works.

Greetings,
Nepomuk
Jun 29 '11 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Phillip Montgomery | last post by:
Hello all; I'm trying to debug an issue with a java script called, SelectSockets. It appears to be a fairly common one found on the web. I downloaded the SGI Java v1.4.1 installation from SGI's...
0
by: asj | last post by:
luke: BORRRRRRRRING......the most interesting initiatives are happening on the client side - in small wireless devices such as cellphones and smartphones, where J2ME has become the de facto...
22
by: Qopit | last post by:
Hi there, I'm pretty new to Python and am trying to figure out how to get "will this code compile?"-like code checking. To me this is a pretty basic language/environment requirement, especially...
1
by: sherifffruitfly | last post by:
Hi, I've got a checked list box, and a "go' button on the form. Each item in the checked list box is associated with a program (say notepad, calc, etc.). When the user clicks "go", every item...
14
by: mlw | last post by:
Do not take anything about this, it is not a flame or troll, while I'm not new to Java I favor C++. However, I may need to use it in a contract position, and am concerned that the restrictions it...
11
by: hamiltongreg | last post by:
I am new to Java and am having problems getting my program to compile correctly. My assignment is as follows; Choose a product that lends itself to an inventory (for example, products at your...
4
by: jmitch89 | last post by:
I don't why I get this error: Exception in thread "main" java.lang.NoClassDefFoundError The statement below works just fine: java -cp...
3
by: ohadr | last post by:
hi, i get Exception in thread "main" java.lang.NullPointerException when i run my application. the exact error is: "Exception in thread "main" java.lang.NullPointerException at...
1
by: onlinegear | last post by:
HI i am writing this for college i know i have loads of combo boxes with nothing in the i havent got that far yet. but every time i run this is comes up with this erro run: Exception in thread...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.