• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java in Notepad++

 
Ranch Hand
Posts: 128
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why can't I run JAva code in Notepad++. I followed this tutorial(http://www.quarkphysics.ca/scripsi/java_notepad/#part3) and I was able to compile but not run the program. Instead I get this strange error??



Full Error:


NPP_EXEC: "Java-run"
CD: F:\
Current directory: F:\
"\java\jdk1.8.0_66\bin\java" -classpath "F:\" "Draw4Ovals"
Process started >>>
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-server to select the "server" VM
The default VM is server.

-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose:[class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
Warning: this feature is deprecated and will be removed
in a future release.
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
Warning: this feature is deprecated and will be removed
in a future release.
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions with specified granularity
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions with specified granularity
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
<<< Process finished. (Exit code 1)
================ READY ================
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can you post the error as actual text instead of a screencap? This a) allows me and other to read it, and b) allows the text to be searchable.
 
Marshal
Posts: 79151
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Avoid unusual means of executing code until you are more experienced. Use the command line as described for example in our FAQ. There is something not quite right about those scripts; they are probably very version‑specific and would need updating whenever a new version of Java® becomes available.
Assuming you do not have a package name in there which you haven't shown us (another risk of screenshots) you should be able to compile and run the code with
javac DrawOvals.java
java DrawOvals

There appears to be a discrepancy between the script they gave and your current Java® version.
 
John Losty
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
javac... command obviously works but java command doesn't.
 
Campbell Ritchie
Marshal
Posts: 79151
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And what happens when you run the java command? Start with
java -version
javac -version

and tell us what the output for those two commands is.
 
John Losty
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where should I type that in. I have no access to cmd (I am on a public computer).
 
John Losty
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I figured it out and it works now. The file has to be in a folder for example:
 
Campbell Ritchie
Marshal
Posts: 79151
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

John Losty wrote:. . . I have no access to cmd (I am on a public computer).

Start→run→"cmd"?
 
John Losty
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I get a message: "you do not have the rights to use this program..." or something along those lines.
 
Campbell Ritchie
Marshal
Posts: 79151
377
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Damn! There is precious little you can do about that, short of buying your own computer. Or borrowing a friend's.
 
John Losty
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
as I said before I can run Java on public computer. I solved the problem.

I already have my own computers.
 
Greenhorn
Posts: 14
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

John Losty wrote:I get a message: "you do not have the rights to use this program..." or something along those lines.



open notepad, type in it COMMAND.COM
-save it as a batch file *.bat

--have fun
 
Campbell Ritchie
Marshal
Posts: 79151
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you think that will actually work if the OP doesn't have access to the command line?
 
Janko Livic
Greenhorn
Posts: 14
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Do you think that will actually work if the OP doesn't have access to the command line?



yes, i tried it.
 
Marshal
Posts: 4491
572
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Janko Livic wrote:open notepad, type in it COMMAND.COM
-save it as a batch file *.bat


This might work on a 32-bit Windows installation (as long as script processing is not also disabled), but will not work on 64-bit versions of Windows - they do not have the command.com executable.
 
Ranch Hand
Posts: 270
15
Android Angular Framework Spring AngularJS Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A bit off topic, I fear, but I have a comment. I have used Notepad++ for various things for quite a while. It handles the line-ending problem handily for windows, at the very least. I like its multi-tab as well.

However, since switching to Windows 10, I have seen a problem where I cannot use its file-browse to open files. I can only open its previous state, or give it a command line args. Firefox does the same. And the problem appears to 'set in' after a couple of uses. Sometimes you can open a file or two before it happens. I do not know if this affects all 32-bit code or what. Of course, M$ own Edge works fine.

Has anyone else seen problems like this, and know the solution? It may be something I had installed prior to the upgrade, causing a conflict somewhere.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic