File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes Notepad++ inquiry Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Notepad++ inquiry" Watch "Notepad++ inquiry" New topic
Author

Notepad++ inquiry

Rodge Paroissiaux
Greenhorn

Joined: Aug 12, 2013
Posts: 22

Notepad++ is really cool, but I am new to programming and want to learn the basics before I jump into IDE specific benefits. Even if only for a few days or weeks, but I am unable to run code, even with the Npp Java Tools plugin I downloaded from a site I came across looking into this issue myself. Are there any Npp experts out there that can help me get the hang of how Npp works and how to run/execute/modify/save classes and such to learn it? Any help would be greatly appreciated.

On a side note, the exercise 1-1 in Murach's Java Programming, 4th Edition, which I am using, it has me opening two separate projects in NetBeans, but I am unable to do this in Notepad++, even when I run two instances. Am I doing something wrong here? I am thinking Mr. Murach has made optional coding more difficult that it should be. I just want to learn how this works from a beginner level to ensure I build up slowly and steadily. I am in no rush to learn this material, time is not against me. This is me learning, and nothing more. I will go as slow as necessary to ensure I do it right. I am in no rush and will take different approaches if necessary to learn the dis-/advantages of Java/OOP. I have all day.

Oh yeah, here is the first chapter if you want to look at the material:
http://murach.com/dloads/javp/javp_ch1.pdf
I just created a long string of numbers for the email address and a bunch of random letters for the name. It will allow you to open it after that. I have the actual book in front of me, so I am not going off of this electronic version, I just saw it online for free and thought I'd list for reference.


-Rodge
“Don’t call me a mindless new programmer, you overweight glob of grease.”
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61095
    
  66

As outlined in the other topic, I'd avoid using "tools" in a editor.... it's the same as using the IDE as a crutch.

Save your .java files as simple text files and use the command line tools to compile and run them. Otherwise, you're learning how to use the tool, not how to use Java.

Essentially, the following:
... want to learn the basics before I jump into IDE specific benefits. Even if only for a few days or weeks, but I am unable to run code, even with the Npp Java Tools plugin

says "I don't want to use an IDE, so how do I use Notepad++ as an IDE?"


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7700
    
  20

Rodge Paroissiaux wrote:Notepad++ is really cool, but I am new to programming and want to learn the basics before I jump into IDE specific benefits. Even if only for a few days or weeks...

Or months. I'd give it at least two before you download an IDE. And when you do, try out a few before you decide which one you like best. Netbeans is just one of many.

but I am unable to run code, even with the Npp Java Tools plugin I downloaded from a site I came across looking into this issue myself...

Ooof. Bad move. You shouldn't need anything to write, compile or run a Java program (even involving several classes and packages) except the JDK and Notepad++ (good choice, BTW).

On a side note, the exercise 1-1 in Murach's Java Programming, 4th Edition, which I am using, it has me opening two separate projects in NetBeans

Again: Ooof. And this is a book for beginners? I fear they may be selling you a "shining path to Java programming" available for 49.99 at your local Radio Shack.

Seriously, I'm very worried that this book:
(a) is NOT for beginners; or
(b) has an agenda that you don't know about - ie, to sell you some software or (possibly worse) a methodology that requires you to buy in to "their way of doing things". All I can say is: DON'T; unless you want to be the programming equivalent of a "Moonie".

Programming is a profession, like engineering. You learn, and in the process you try and fail and bash your head against the screen (and you have these nice soft flat-screen things now); that's the nature of the beast. There is no "magic bullet", and any book that claims that you can bypass that process (and I have no idea whether yours does) is WRONG.

However, before I say any more about the book you're using, I need to do some Internet searching. Suffice to say, from what I've heard, and if it is a beginners book, I don't agree with its approach. AT ALL.

Winston

Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61095
    
  66

It would be a logical fallacy to say that every Murach book is bad because all of the Murach books that I've looked at were not so great; but I can say that all of the Murach books that I've looked at were not so great

This is not one that I have looked at.
Rodge Paroissiaux
Greenhorn

Joined: Aug 12, 2013
Posts: 22

Bear Bibeault wrote:As outlined in the other topic, I'd avoid using "tools" in a editor.... it's the same as using the IDE as a crutch.


Bear Bibeault wrote:Save your .java files as simple text files and use the command line tools to compile and run them. Otherwise, you're learning how to use the tool, not how to use Java.

I have these text files, but am unable to utilize them as in the cmd window. So how do I use it like the cmd window? I see what you are saying, it looks like I still have some learning on how and why.

Bear Bibeault wrote:says "I don't want to use an IDE, so how do I use Notepad++ as an IDE?"

Wow, you are spot on here, yeah, pretty dumb on my part. LOL. I will uninstall these, then. I need to find a Npp tutorial for coding in Java... or maybe I will just stick to the cmd window. NetBeans is okay for the examples, especially since using NetBeans menus and such are part of the examples, but I want to learn the coding, not the IDE in which I am doing the coding. /sigh So lost... I feel like I am being pulled in two directions, I need to step back, focus on the basic approach for cmd/npp and go with that. I want to get away from the IDE if possible, especially if I can go through the examples in the book without it.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61095
    
  66

I think you need to find a book or tutorial that focuses on the JDK command line tools:
  • javac for compiling
  • java for running


  • To create the .java files, all you need is a text editor.

    Smart editors (and IDEs) are nice because they provide automatic indenting, and code completion, and syntax highlighting. But that's all fluff for now. All you really need to get started is a text editor, javac, and java.

    Winston Gutkowski
    Bartender

    Joined: Mar 17, 2011
    Posts: 7700
        
      20

    Rodge Paroissiaux wrote:Wow, you are spot on here, yeah, pretty dumb on my part. LOL. I will uninstall these, then. I need to find a Npp tutorial for coding in Java... or maybe I will just stick to the cmd window.

    One more time: Ooof. Is this how things work in the military?

    I don't think anybody's suggested that you uninstall; simply that you use Npp for now.

    Quick tutorial for you:
    1. Download Npp.
    2. Open it.
    3. Click the 'Settings' tab and then 'Preferences'.
    4. On the left hand side you'll see a list. Click 'File Associations'.
    5. Under 'Supported exts' click the entry that starts with 'java', then the '.java' entry to its right.
    6. Click the right arrow.
    7. Close the program and re-open it with a .java file. It should be highlighted correctly.
    That's it. It's an editor. You'll be using Java's commands to actually do stuff with what you write.

    NetBeans is okay for the examples, especially since using NetBeans menus and such are part of the examples, but I want to learn the coding, not the IDE in which I am doing the coding.

    And, as I said before, your instinct is absolutely right. It's your book that's wrong - at least, IMO.

    /sigh So lost... I feel like I am being pulled in two directions, I need to step back, focus on the basic approach for cmd/npp and go with that. I want to get away from the IDE if possible, especially if I can go through the examples in the book without it.

    You know what? Your instincts are great. Trust them (especially the "stepping back" part; you'd be amazed how many programmers can't do it).

    My worry - still, I have to say - is your book. Are you sure this is one for beginners?

    Winston
    Rodge Paroissiaux
    Greenhorn

    Joined: Aug 12, 2013
    Posts: 22

    Bear Bibeault wrote:I think you need to find a book or tutorial that focuses on the JDK command line tools:
  • javac for compiling
  • java for running


  • To create the .java files, all you need is a text editor.

    Smart editors (and IDEs) are nice because they provide automatic indenting, and code completion, and syntax highlighting. But that's all fluff for now. All you really need to get started is a text editor, javac, and java.


    Bear, I apologize, I have not asked the right question now that I have looked back; I was speaking in general terms so I will resolve it now. Here is a series of questions so that I can grasp more understanding:

    1. Does Notepad++ run from the PATH and CLASSPATH I have set in my Windows settings? For example, my PATH is C:\Program Files\Java\jdk1.7.0_25\bin\.
    2. If so, how from within Notepad++? I can run the javac, java, javadoc commands from holding Win-key + R then typing cmd then typing javac TestApp.java to run the TestApp, but as far as running javac TestApp.java from within Notepad++ I am unable to find any documentation of the sort in getting that done. Is there some hidden keyboard shortcut? Or am I still to use cmd for javac initiation? I would like to stay within the forum of where I am writing the code without swapping out to cmd if possible, but if it is not, then I will continue to do as I am, swapping between the two.

    Again, sorry for the general hints, I should have asked it this way from the beginning. And me being 110% honest, "Thank you!" You are helping me so much, you have no idea how grateful I am for your patience and mentoring in all of this. And Winston, you too, not to leave you out; you two rock!
    Rodge Paroissiaux
    Greenhorn

    Joined: Aug 12, 2013
    Posts: 22

    Winston, I have the file association now, and I am able to open the .java file, but when I hit F5 (Run,,,), it gives me a Run... window and a dropdown to "The Program To Run", yet the dropdown is empty.

    I select javac from the \bin folder and to no avail. Hmm...
    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 61095
        
      66

    Clicking around on things in the Windows GUI isn't going to get you much of anywhere. You need a command line.

    I don't use Windows so I can't give you a step by step. But The Windows Run command want s to run a Windows executable; it doesn't know tiddly about Java.

    Did you explore cygwin as I suggested?
    Rodge Paroissiaux
    Greenhorn

    Joined: Aug 12, 2013
    Posts: 22

    Winston Gutkowski wrote:
    Rodge Paroissiaux wrote:Wow, you are spot on here, yeah, pretty dumb on my part. LOL. I will uninstall these, then. I need to find a Npp tutorial for coding in Java... or maybe I will just stick to the cmd window.

    One more time: Ooof. Is this how things work in the military?
    I don't think anybody's suggested that you uninstall; simply that you use Npp for now. for you:


    I uninstall on habit; if I don't use it, it is gone...
    Winston Gutkowski
    Bartender

    Joined: Mar 17, 2011
    Posts: 7700
        
      20

    Rodge Paroissiaux wrote:I uninstall on habit; if I don't use it, it is gone...

    I hate to say, but possibly not the best policy if you're working with Windows. It has a nasty (and enormous) secret monster working in the background called "The Registry" which, like the Catholic Church, takes heed of everything you do; and the trouble is that people who send you software either don't know (or don't want to know) how it works. and so, even when you click "uninstall", the monster remembers.

    So, my advice with Windows:
  • Install things when (and only when) you need them.
  • Don't trust any "uninstall" program farther than you could throw a boat anchor.

  • I say this as someone who uses, but doesn't really understand (or trust), Windows you understand.

    Winston
    Rodge Paroissiaux
    Greenhorn

    Joined: Aug 12, 2013
    Posts: 22

    Bear Bibeault wrote:Did you explore cygwin as I suggested?


    Okay Bear, I installed this cygwin, but not sure where to start on a compiling level. I found a bunch of free games and such, but nothing special in my opinion. This is really cool though, but where do I start? I see I need to set my path for this compiler, but how do I tell it all of this? Wait, let me get on duckduckgo.com and do some research, hold off on that. Sheesh, this is a weird, yet highly creative program. Thanks for introducing me to this one.
    Winston Gutkowski
    Bartender

    Joined: Mar 17, 2011
    Posts: 7700
        
      20

    Rodge Paroissiaux wrote:This is really cool though, but where do I start? I see I need to set my path for this compiler, but how do I tell it all of this? Wait, let me get on duckduckgo.com and do some research, hold off on that. Sheesh, this is a weird, yet highly creative program. Thanks for introducing me to this one.

    Basically, it's a Unix prompt on a Windows system - although there's a bit more to it than just that. Personally, it seems to me like a bit of a "halfway house" for those who've been brainwashed by Gates.com into the idea that they can't survive the day without their Windows fix.

    You're the guy that likes to install and "if you don't use it, it's gone" - so if you really like what you see in Cygwin, be a man and trash Windows for the real thing, and find out what a proper operating system can do.

    Just kidding for now - but maybe not in 6 months time. But do be sure to back up ALL your essential stuff before you do anything that drastic.

    Oh, and in the world of Linux: pretty much everything you use - including Office and Photoshop Pro (or rather, their equivalents: OpenOffice and Gimp) - are FREE. Saves you about 500 bucks right there.

    Winston
    Piet Souris
    Ranch Hand

    Joined: Mar 08, 2009
    Posts: 530
        
        8
    I have the feeling that this discussion is going the complete wrong way.

    Winston's quick tutorial about this Npp is longer than a quick tutorial to an executable jar, using NetBeans and the like. For instance:

    press the button in the left upper corner of NetBeans to start a new project
    type the name of the project and press 'ok'
    start typing the code in the big white panel in the centre
    press the run button to run the program
    press another button to create an executable jar


    No command line horrors, no classpath misery, no cygwin, no ...

    And if all the red circles before the code lines in th program panel scare you off, well, you would have to deal with
    these things anyway once you manually try to compile your program.

    And, last but not least: if I look at my 'Start' menu in Windows, there is no option of any command line window at all.
    And I've forgotten how to get one.

    Greetz,
    Piet
    Winston Gutkowski
    Bartender

    Joined: Mar 17, 2011
    Posts: 7700
        
      20

    Piet Souris wrote:I have the feeling that this discussion is going the complete wrong way.
    Winston's quick tutorial about this Npp is longer than a quick tutorial to an executable jar, using NetBeans and the like.

    You think? It took me a good month to learn Netbeans, and one primary reason was that nowhere - absolutely nowhere - in their stupid tutorial did it tell me what a 'Project' was. It's a fairly basic question for a beginner surely: What is a Project, and why on earth would I want to set one up? Why can't I just write a class and run it - as you can with JEdit, for example?

    And as for Eclipse (which I use now): I still don't know how to get that darn "which workspace would you like to open" prompt back after I've clicked the "Don't ask me again" checkbox. I'm quite sure there is a way, but my current solution: wipe, re-install, set up a new workspace and import my Projects...and don't click that damn checkbox again. EVER.

    Don't get me wrong; I have nothing against IDEs, but they
    (a) hide too much stuff from beginners.
    (b) each have their own idiosyncratic "shining path".

    But I will concede that the Cygwin/Windows/Linux digression is slightly off-topic. Fun though.

    Winston
    Piet Souris
    Ranch Hand

    Joined: Mar 08, 2009
    Posts: 530
        
        8
    Winston wrote
    And as for Eclipse (which I use now): I still don't know how to get that darn "which workspace would you like to open" prompt back after I've clicked the "Don't ask me again" checkbox. I'm quite sure there is a way, but my current solution: wipe, re-install, set up a new workspace and import my Projects...and don't click that damn checkbox again. EVER.




    Same here: sometimes in NetBeans I do something (or even nothing) and then one of my subpanels has gone into oblivion! But somehow I've always managed to get them back.

    But I prefer all this way over command lines, that I've hated all my life
    Winston Gutkowski
    Bartender

    Joined: Mar 17, 2011
    Posts: 7700
        
      20

    Piet Souris wrote:But I prefer all this way over command lines, that I've hated all my life

    Aah. A child of "the Gates generation". I guess we'll just have to agree to disagree on this one.

    Winston
    Paul Anilprem
    Enthuware Software Support
    Ranch Hand

    Joined: Sep 23, 2000
    Posts: 3285
        
        7
    Rodge Paroissiaux wrote:
    Bear Bibeault wrote:Did you explore cygwin as I suggested?


    Okay Bear, I installed this cygwin, but not sure where to start on a compiling level. I found a bunch of free games and such, but nothing special in my opinion. This is really cool though, but where do I start? I see I need to set my path for this compiler, but how do I tell it all of this? Wait, let me get on duckduckgo.com and do some research, hold off on that. Sheesh, this is a weird, yet highly creative program. Thanks for introducing me to this one.

    While cygwin is a good tool, I don't think it is a good idea to add complexity to achieve what you are trying to do. First, get a simple hello world program running from your windows command prompt. Here is a simple 3 step process: http://www.oxfordmathcenter.com/drupal7/node/14

    Can't get any simpler than that. Once you do that, google the -d option of javac tool, the -classpath option of java tool, and the package statement of the java language. These are three things that you absolutely MUST understand. Everything else will fall easily into place.

    I assume you know how to get the command prompt - Start -> Run -> cmd (enter)


    HTH,
    Paul.


    Enthuware - Best Mock Exams and Questions for Oracle/Sun Java Certifications
    Quality Guaranteed - Pass or Full Refund!
    Scott Shipp
    Ranch Hand

    Joined: Mar 31, 2013
    Posts: 121
        
        6

    Rodge Paroissiaux wrote:Notepad++ is really cool, but I am new to programming and want to learn the basics before I jump into IDE specific benefits. Even if only for a few days or weeks, but I am unable to run code, even with the Npp Java Tools plugin I downloaded from a site I came across looking into this issue myself. Are there any Npp experts out there that can help me get the hang of how Npp works and how to run/execute/modify/save classes and such to learn it? Any help would be greatly appreciated.

    On a side note, the exercise 1-1 in Murach's Java Programming, 4th Edition, which I am using, it has me opening two separate projects in NetBeans, but I am unable to do this in Notepad++, even when I run two instances. Am I doing something wrong here? I am thinking Mr. Murach has made optional coding more difficult that it should be. I just want to learn how this works from a beginner level to ensure I build up slowly and steadily. I am in no rush to learn this material, time is not against me. This is me learning, and nothing more. I will go as slow as necessary to ensure I do it right. I am in no rush and will take different approaches if necessary to learn the dis-/advantages of Java/OOP. I have all day.

    Oh yeah, here is the first chapter if you want to look at the material:
    http://murach.com/dloads/javp/javp_ch1.pdf
    I just created a long string of numbers for the email address and a bunch of random letters for the name. It will allow you to open it after that. I have the actual book in front of me, so I am not going off of this electronic version, I just saw it online for free and thought I'd list for reference.


    I did find this video which looks like what you're after. And Notepad++ is totally not IDE-like in my opinion. I consider it a text editor and perfectly suitable for beginners who don't need the complexity or the "rails" that an IDE offers.
    Scott Shipp
    Ranch Hand

    Joined: Mar 31, 2013
    Posts: 121
        
        6

    Winston Gutkowski wrote:

    And as for Eclipse (which I use now): I still don't know how to get that darn "which workspace would you like to open" prompt back after I've clicked the "Don't ask me again" checkbox. I'm quite sure there is a way, but my current solution: wipe, re-install, set up a new workspace and import my Projects...and don't click that damn checkbox again. EVER.

    Winston


    Window > Preferences > General > Startup and Shutdown > Workspaces. Check "Prompt for workspace on startup."
     
    It is sorta covered in the JavaRanch Style Guide.
     
    subject: Notepad++ inquiry