How to fix internal or external command errors in Netbeans? - java

It builds fine, but when netbeans tries to start the emulator, the following error occurs:
'Blackberry' is not recognized as an internal or external command, operable
program or batch file.
I'm searching for a general solution. Because I found many of the same type of errors on the net (But each one without an answer).
'xxx' is not recognized as an internal or external command, operable
program or batch file.
So how do you make Netbeans recognize 'xxx'?

add the path to your executable to your system path variable .
it will look at those path while executing any executable if executable found from any of those path it OR from current dir it will execute otherwise it will throw the same error.
For Linux you have
PATH=$PATH:/home/user/path/to/executable
for windows you will have something like ,edit it. follow this tutorial for more info

Related

'javac' is not recognized as an internal or external command, operable program or batch file. in VS Code, using Code Runner extension

I am trying to run some java code in VS Code with the Code Runner extension, but i keep getting this:
'javac' is not recognized as an internal or external command,
operable program or batch file.
I checked all the paths and updated the path in VS Code, but it did nothing.
Assume you are on the Windows System.
First, you might want to add your jdk path to window system environment.
Then, open your VS Code, and go to User Settings located under File -> Preferences -> User Settings.
Add jdk PATH in your VS Code as the following shows.
Important Step: after all above steps are done, you might want to restart the VS Code to let change go in effect.
To test if it works, open Integrated Terminal in VS Code under View (or type Ctrl + ` (this key is located next to number 1)
Once the terminal shows up and is initialized, type javac to verify VS Code recognize the command.
[On Windows]
Although it is called "bin path", the "bin" folder is not supposed to be included in the path. If you do, you get an error and VSCode asks you to remove "bin" from the path in order to solve the issue.
So the path to be added in settings.json should be something like:
"C:/Program Files/YOUR JDK/(YOUR JDK VERSION)-hotspot".
(and not "...-hotspot/bin")
Try and add the jdk bin path to the system environment variable otherwise u need to save the Java code inside the bin folder and compile it from there.

The system cannot find the file C:\play\bin\..\conf\sbtconfig.txt

ACTIVATOR_HOME=C:\play
The system cannot find the file `C:\play\bin\..\conf\sbtconfig.txt.
'findstr' is not recognized as an internal or external command, operable program or batch file.
The syntax of the command is incorrect.
I'm facing this problem while installing the play framework.
I intalled sbt and Scala as referenced by one tutorial on the internet, but in vain.
My Java JDK is working properly and sbtconfig.txt file is not in play bin where above file is point to.
Please can anyone help me?
If you do not provide sbtconfig.txt then installer will throw warning but it will not stop. I have successfully installed play2 even after that message.
So please check that SBT_HOME and ACTIVATOR_HOME are correctly configured. But you got some other error like 'findstr' not found. So try both from creating a command shell and also by double clicking the batch file. I hope that can solve the problem.

Batch file not executing the required commands in windows 8.1

I have created a batch file to set the path of a jar file whenever i need to use that jar file.But even after executing the file,the system is unable to recognize the jar file and when i compile my java program which uses that jar file,it gives compile time error(i.e the path is not set).
And when i simply use the classpath command in command prompt which i wrote inside the batch file,it works.
But i want to make a batch file so that whenever i need to set classpath,i can use that batch file.
Help will be appreciated.
Following is the batch file.
set classpath=jsoup.jar;.;%classpath%
Solution found by OP:
Thanks,I solved the problem.I just made a .cmd file containing the command.Now whenever i will need to set the path i will run that cmd file in command prompt.

how to identify java class path and name to trouble shoot java

I'm using a java bootstrapping command to update a web application according to an xml file I've configured. The xml file has been checked and it's formatted correctly and referenced correctly in the script.
The problem: I keep getting an error that the system could not find or load the main class.
What I would like to do is to view the contents of the jar file. I know that to do this, I should run:
jar tf jarfilenameandpath
What I don't know is WHERE I should run the command. I tried it from a windows command prompt and received the following error:
'jar' is not recognized as an internal or external command, operable file, or batch file.
You don't have to run that command to see whats there in .jar better
way to do it is download the Java Decompiler
See all the classes and try to find the conflict. If everythings looks fine. The only way you can solve this problem is by debugging it.
Did you set Java PATH variable on your Windows machine?
For more details on de-compilers, visit this page on stackoverflow

Java program unable to execute from command prompt

I recently installed a java software in my PC and started writing some simple programs. I didn't face any problem while compiling the programs, but while executing it, it shows this error message -
"Windows can't open this file.
File: HelloWorld.java
To open this file, windows need to know what program you want to open it. Windows can go online to lookup it automatically, or you can manually select from a list of programs that are installed on your computer.
I know all the path settings are correct. In fact, there was no problem at all while compiling the program. What can be the problem of this? I even reinstalled JRE and that didn't help. Can someone help me?
Note: I'm using Windows 7 64 bit architecture OS and I'm using command prompt for compilation and execution of the file.
I'll assume that you've double-clicked the .java file, e.g. in the file explorer. A java source file isn't a (click-launchable) executable, and - without some acrobatics - neither is a compiled .class file: you shouldn't expect to double-click either and start your program.
In order to get this sort of behavior, you'll need to build a launchable program, and there are a few ways to do this. One is by making a batch file that runs the java VM with your code, another is creating an executable jar file.
To just run your code outside your IDE, you can invoke the java VM on the command line:
c:\> java HelloWorld
As to your specific error message, you haven't associated any program with .java files. Typically, as programmers, we want this Windows file association to be our editor of choice or our IDE. You can create this association by Right-clicking on the file, choosing Properties from the menu and then clicking the Change button beside Opens with: to pick an application.
But this is a side-issue: you still won't use this to make .java file executable. Search around this site for questions and answers about building executable jar files. If you're using a specific IDE like Eclipse or NetBeans, use that to refine your search.
When you want to execute the program, you specifiy the class name rather than the file name:
java HelloWorld
Don't use java HelloWorld.java, for instance.

Categories