problems with jar file in netbeans ide - netbeans

I have done rfid reader program in netbeans ide, works fine. then,I created executable jar file by following the steps.
In the netbeans main window,
(i)select the properties under the project folder under properties > build >packaging then enter OK.
(ii)Select Run tab in main window then clean and build Main project.
After these steps, the executable jar file is created in documents> netbeansprojects>project name folder>dist.
I run the jar file from command prompt by
java -jar C:\Users\Holoteq-PC01\Desktop\RFID1\RFIDreader.jar
then i got the error as
Error: could not open C:\Program Files(x86)\Java\jre1.8.0_161\lib\i386\jvm.cfg
why the error comes like that?
i checked java location by where java then the response is
C:\ProgramData\Oracle\Java\javapath\java.exe
C:\Windows\System32\java.exe
C:\Program Files\Java\jdk1.8.0_77\bin\java.exe
I read multiple questions pertaining to this issue,i tried almost but the error persists. Can anyone help me to resolve this issue.

Related

Eclipse launching Debugger has encountered a wrongly combined paths to an executable

Eclipse problem occurred when I tried to launch debugger. I think that Eclipse tool wrongly combined the path to the executable file.
How to configure for '-exec-run' command in order that Eclipse can determine correct paths?

Eclipse is not able to find sources during debug

I'm building my c/c++ application for arm controllers with gcc in a docker. There together with the .hex and .bin file also the .elf file is generated. Once generated they all are exported out from the container to the host machine. Now I would like to debug the application with openocd, arm-none-eabi-gdb and eclipse cdt. I'm able to start debug session on the target board, but when I stop the debugger (or it stops on its on at startup on main) it is not able to find the source files to show:
Can't find a source file at "/usr/src/Testbench/LIBS/Shell/shell.c"
The path here is the one of the build project in the docker container and has nothing to do with the new debug project on the host where all files are located now.
I tried to edit source lookup path in eclipse with no luck, I could find the file an then it worked for just that file. Also specifying the folders did not work. Anyway, doing it manually always for all files/folders in the project is not an option.
The solution should be "scripted" since all this is part of a CI/devops concept.
It seems that the "wrong" path is hard coded in the elf file. Is there a (scripted) way to change that path to match the actual project location so that eclipse and gdb just work as expected and the developper can see the debug info when debugging?
Possibly it should work on Linux and Windows ;-)
Thanks in advance for your help
Martin
Now it works! In eclipse in the debug configuration in the gdb commands I added :
set substitute-path /usr/src/ ${workspace_loc}
Then I had to go to the source lookup path in eclipse and remove everything.

PhantomJS Project in Eclipse (with Nodeclipse): NullPointerException when trying to run js file that is present in a folder

I wish to create a PhantomJS Project in Eclipse for which I have installed the Nodeclipse PhantomJS 0.12+ plugin. I am selecting the below project type:
The script runs fine when I arrange the project in the following way (without any folders).
But, when I place the same .js file in a folder and try to run it, I end up getting a NullPointerException (see screenshot below).
The error that I'm getting is below:
An internal error occurred during: "Launching PhantomJSTest-Test1.js".
java.lang.NullPointerException
Screenshot:
What I have tried:
I found a similar question on Stackoverflow with the same error but for Android. I have tried cleaning, building the project. But, the error occurs only when I create a folder structure in my project. If I don't, then the script runs fine. In short, I am not able to organize the project.
Questions:
I'd like to know what type of folder structure is valid / will work for a PhantomJS project?
Why is the NullPointerException occuring?
Are there any other easy alternatives to setting up a PhantomJS project?
Any help / guidance regarding the folder structure is highly appreciated.
First get the latest version, that is 0.17, see news/history at http://www.nodeclipse.org/
If the problem is still on, raise issue on https://github.com/nodeclipse/nodeclipse-1/ (and reference this question)
To the questions:
PhantomJS launcher is rather simple https://github.com/Nodeclipse/nodeclipse-1/tree/master/org.nodeclipse.phantomjs, and it should work for any .js file (in any project type). PhantomJS project type is for beauty sake only, as it is just JavaScript project.
NullPointerException should occur never, so it may be bug.
You can create general project as well. But with JSDT and Tern you would get some Content Assist. For new module support with Tern raise issue at https://github.com/angelozerr/tern.java/
I switched to using Enide Studio and that solved the folder structure issue for me.
Here's what is needed to setup PhantomJS Project:
PhantomJS
Enide Studio
Steps:
Download PhantomJS
Download and launch Enide Studio
Goto Window->Preferences->Nodeclipse->PhantomJS and set PhantomJS Path to 'phantomjs.exe' file path
Create a PhantomJS Project (like any normal project)

Creating jar executable w/ external jar (JXL) in ECLIPSE java

I can't find a working solution for my jar executable. The program runs perfect in my Eclipse IDE, but when I attempt to follow Eclipse instructions, the executable does not work with external JAR.
The JXL jar is in my build path. Anyone know how to get this working through Eclipse? I do not have access to command line.
1.) Right-click on project, select pop-up menu entry "Export...".
2.) Select "Java -> Runnable JAR file".
3.) Choose a working launch configuration for running your program via java -jar MyExecutable.jar from the command line later. Select an output folder and file name. Select "Package required libraries into generated JAR".

Specify the -jar option in the file association Windows 8, Netbeans

I'm following this guide on how to make your program in Netbeans into a standalone executable that can be distributed:https://netbeans.org/kb/articles/javase-deploy.html#troubleshooting
I cleaned and built the project in Netbeans, then tried double clicking the .jar in the dist folder of the project folder, but nothing happened. I then ran the project through the command line, going to the dist folder of the project and then typing java -jar "FileName.jar", and it ran perfectly fine.
The .jar file in the dist folder has a java logo, so I assume that it's not because of the first reason in the "Troubleshooting JAR File Associations" section of that guide. I suspect that it's because of the second reason.
And here's where I need help. I've tried following the path that they give, but I'm running Windows 8 and I can't find the "File Types" tab in "Folder Options", and so I can't go any further. Anyone know what to do?
See "how to run .jar file by double click on windows 7 (64)", "jar file doesn't open upon double click", "Running Jar file in Windows", and probably a few other answers here on StackOverflow.
From NetBeans.org, see the "Troubleshooting JAR File Associations" section of the "Packaging and Deploying Desktop Java Applications" knowledgebase article.