Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 13 of 13

Thread: How to make NP++ Compile and Run Java programs

  1. #1
    Junior Member
    Join Date
    Sep 2018
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Question How to make NP++ Compile and Run Java programs

    For a while I just used command prompt to compile my code but it's just starting to get annoying having to open it up every time. I tried using NPPexec to do it but I just keep getting this message

    Input:
    cd desktop
    cd code
    javac $(FILE_NAME.JAVA)
    java $(NAME)
    Output:
    CD: desktop
    Current directory: C:\Program Files (x86)\Notepad++
    CD: code
    Current directory: C:\Program Files (x86)\Notepad++
    javac
    Process started (PID=10156) >>>
    Usage: javac <options> <source files>
    where possible options include:
    -g Generate all debugging info
    -g:none Generate no debugging info
    -g:{lines,vars,source} Generate only some debugging info
    -nowarn Generate no warnings
    -verbose Output messages about what the compiler is doing
    -deprecation Output source locations where deprecated APIs are used
    -classpath <path> Specify where to find user class files and annotation processors
    -cp <path> Specify where to find user class files and annotation processors
    -sourcepath <path> Specify where to find input source files
    -bootclasspath <path> Override location of bootstrap class files
    -extdirs <dirs> Override location of installed extensions
    -endorseddirs <dirs> Override location of endorsed standards path
    -proc:{none,only} Control whether annotation processing and/or compilation is done.
    -processor <class1>[,<class2>,<class3>...] Names of the annotation processors to run; bypasses default discovery process
    -processorpath <path> Specify where to find annotation processors
    -parameters Generate metadata for reflection on method parameters
    -d <directory> Specify where to place generated class files
    -s <directory> Specify where to place generated source files
    -h <directory> Specify where to place generated native header files
    -implicit:{none,class} Specify whether or not to generate class files for implicitly referenced files
    -encoding <encoding> Specify character encoding used by source files
    -source <release> Provide source compatibility with specified release
    -target <release> Generate class files for specific VM version
    -profile <profile> Check that API used is available in the specified profile
    -version Version information
    -help Print a synopsis of standard options
    -Akey[=value] Options to pass to annotation processors
    -X Print a synopsis of nonstandard options
    -J<flag> Pass <flag> directly to the runtime system
    -Werror Terminate compilation if warnings occur
    @<filename> Read options and filenames from file

    <<< Process finished (PID=10156). (Exit code 2)
    java
    Process started (PID=5944) >>>
    Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'
    has value '1.8', but '1.7' is required.
    Error: could not find java.dll
    Error: Could not find Java SE Runtime Environment.
    <<< Process finished (PID=5944). (Exit code 2)
    ================ READY ================
    Any one have a solution

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: How to make NP++ Compile and Run Java programs

    Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'
    has value '1.8', but '1.7' is required.
    Does the program's doc discuss what version of java it needs?
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Sep 2018
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: How to make NP++ Compile and Run Java programs

    No. it works when I compile it in six and eight they both work fine.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: How to make NP++ Compile and Run Java programs

    when I compile it in six and eight
    What are "six" and "eight"?
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Sep 2018
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: How to make NP++ Compile and Run Java programs

    Java six and Eight

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: How to make NP++ Compile and Run Java programs

    Are you talking about JRE or JDK?
    How many versions of the Java do you have installed on your system?
    I'm not sure that they are compatible. The installations could walk on parts of earlier installations.
    If you don't understand my answer, don't ignore it, ask a question.

  7. #7
    Junior Member
    Join Date
    Sep 2018
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: How to make NP++ Compile and Run Java programs

    I started out using Six. But then when I swapped to eight and uninstalled six. I have java eight JDK and JRE installed as when I used the installer it installed both of them onto my system.

  8. #8
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: How to make NP++ Compile and Run Java programs

    Can you open a command prompt and enter:
    javac -versiom
    java -version

    copy the contents and paste it here.

    Why is java looking for 1.7? Where did that come from if you only have installed 1.6 and 1.8?
    but '1.7' is required.
    If you don't understand my answer, don't ignore it, ask a question.

  9. #9
    Junior Member
    Join Date
    Sep 2018
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: How to make NP++ Compile and Run Java programs

    javac -version
    javac 1.8.0_191

    java -version
    java version "1.8.0_191"
    Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
    Java HotSpot(TM) Client VM (build 25.191-b12, mixed mode)

    And I do not know why java is looking for 1.7

  10. #10
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: How to make NP++ Compile and Run Java programs

    There is discussion of that problem here:
    https://stackoverflow.com/questions/...currentversion
    If you don't understand my answer, don't ignore it, ask a question.

  11. The Following User Says Thank You to Norm For This Useful Post:

    CJ_sucks_at_programin (November 24th, 2018)

  12. #11
    Junior Member
    Join Date
    Sep 2018
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: How to make NP++ Compile and Run Java programs

    I'm sorry for posting on a closed topic. So I tried the fixes and none of them worked.But I think this is how NPPexec handles as my java works just fine normally.

  13. #12
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: How to make NP++ Compile and Run Java programs

    Yes it could be a problem with NP++. I don't know how it works.
    If you don't understand my answer, don't ignore it, ask a question.

  14. #13
    Junior Member
    Join Date
    Sep 2018
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: How to make NP++ Compile and Run Java programs

    Oh okay, Ill ask someplace else. Thanks for helping though!

Similar Threads

  1. Replies: 6
    Last Post: September 24th, 2014, 11:04 AM
  2. when using TextPad after doing Java Compile how do I get my code to run?
    By Rhiannon1488 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 20th, 2014, 12:33 PM
  3. How do i compile and run java programs using jdk and jcreator
    By SYNTAXTECH in forum What's Wrong With My Code?
    Replies: 1
    Last Post: January 26th, 2014, 04:18 AM
  4. [SOLVED] Java 1.4.2 and eclipse code will not compile or run need it to run for school!
    By ClarmonkGaming in forum What's Wrong With My Code?
    Replies: 12
    Last Post: January 23rd, 2014, 09:41 PM
  5. Want To Compile And Run Java Code At Home
    By Jim Corner in forum Java Theory & Questions
    Replies: 3
    Last Post: December 28th, 2013, 01:00 AM