473,406 Members | 2,816 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,406 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 20127
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.