Jar file won't run - Windows 7 - netbeans

I am trying to run a .jar file that I have created using either the command line and double clicking. The Jar makes a JFrame GUI with button, text, labels etc.. It should display this window.
I have checked and the file is associated with javaw.exe in the correct directly. I have also tried via the command like using java -jar filename.jar and it just paused for a split second and then moves to the next line, no errors.
I have also run javafix which also hasn't helped.
I have reinstalled JRE and JKE and still no luck, the file was created in Netbeans and compiles without problem.
I am using this Netbeans tutorial: Introduction to GUI Building.
Any suggestions? I'm Stumped.

The best I can tell is to Press Win + R and type regedit.exe, Press Enter.
In your Registry Editor Window, Expand HKEY_CURRENT_USER->Software->Microsoft->Windows->CurrentVersion->Explorer->FileExts
Delete the entry or Key Name .jar from the list. Do check the version used by your NetBeans and the one on your classpath. Hopefully they both are same versions, it can be one of the reasons too, for .jar not working. Now again try to run your .jar file. That might help it to run again.
Regards

Related

Eclipse opening and then closing immediately

Eclipse keeps showing the splash screen and then closing immediately after...I just downloaded it so I haven't had the opportunity to make a work space. I've tried uninstalling and reinstalling, the file has already been unzipped at this point I have no idea as to what I should do about this.
Make sure that you have installed Java JDK properly
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Whenever it (Eclipse) encounters a problem that does not warrant launching a dialog, Eclipse saves a report in the workspace log file. The log file can be looked at in four alternative ways.
Locate the file yourself, see workspace/.metadata/.log.
Start Eclipse using -consoleLog. This will print the messages
that normally go to the .log file in the enclosing shell/command window. When the Java VM suffers a hard crash, it produces a separate logging file named something like hs_err_pidXXXXX.log. These files are also helpful for diagnosing
problems.
(Other two might not be useful in your case)
Window > Show View > PDE Runtime > Error Log. This gives you a view
with the contents of the .log file.
Help > About Eclipse Platform > Configuration Details. This
prints out a great number of details about the environment and
also concatenates the .log file. Great for including in a bug
report.
Source
Make sure that Java installed properly..
Uninstall Java and install again, this worked for me

How do I make eclipse.ini stop changing when I restart eclipse?

I recently installed eclipse Luna for Windows 64-bit. I have the ini file customized. Specifically, I have to set the VM path because the reference to Java on the path is for a different JVM that does not work for eclipse.
Every time I close and reopen eclipse, the vm entry in the ini file is removed, so I have to set it all over again and open eclipse. Is there a setting in Luna to change this?
Eclipse itself doesn't do this; there are plugins which sometimes rewrite the ini file to "fix problems" (usually giving Eclipse more memory) and I've seen cases where Eclipse was started with a script that replaced the ini file with a "known good" copy.
In either case, you will have to examine your installation. Use the "About" dialog to find out which plugins are installed and then find out what they are and what they do. One of them is the culprit.
One way to work around the problem is to create a copy of the file as eclipse.config and use a CMD script to start Eclipse. The CMD script should copy eclipse.config to eclipse.ini and then start Eclipse. That way, anyone can change the INI file but it won't matter.

java was started but returned exit code = -805306369

Can anyone help me with this error:
java was started but returned exit code = -805306369
C:\Windows\System32\javaw.exe
-jar C:\Program Files\Java\eclipse-jee-helios-SR2-win32-x86_64\eclipse\plugins\org.eclipse.equinox.launcher_1.11.1.R36x_v20101122_1400.jar
Just had this issue, for me it was a corrupted workspace osgi cache. The solution was to run eclipse with the -clean parameter as
eclipse.exe -clean
After some time, eclipse required to clean up, the workspace selection dialog popped up and I could start eclipse normally again.
The -clean parameter is documented in the eclipse help
My problem was a corrupted workspace the solution was from Rob's link:
http://spacetech.dk/eclipse-failed-java-was-started-but-returned-exit-code-805306369.html
I started getting the same error "exit code = -805306369" just out of no where.
Eventually I looked at the Eclipse logs at the <workspace_directory>/.metadata/.log and realized that my Source Control plugin (Perforce in my case) was unable to connect and the eclipse was stuck.
This was because my eclipse was piggy back(depending) on the client connection that I have with my Perforce windows client and my Perforce client was not connected to the server. I connected my Perforce client and the eclipse started working normal.
this happens when mostly workspace is corrupted..... cooler solution is just to switch the workspace to safer location(new location).... and just import the project from previous workspace... princess can still be saved....
For me , Just change your Workspace to another one
I got this error, when workspace already setted up. Since the java virtual machine cannot be created. try command: java -version
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
I restarted my machine, and it solved my problem.
One of the class file in my project was corrupted. The name of a class file was too long and I was not able to delete or rename it, so I rename the folder containing it and then I was able to delete the project and that solved my problem.
Now i know that my workspace was corrupted, it solved my problem.
Go to your workspace and rename it.
Start your eclipse and by default it will create a workspace.
Go to File -> Switch Workspace, choose your original workspace.
I wasn't able to disable "Automatically find new updates and notify me." The option was not there on the Install/Updates page. Perhaps eclipse workbench has changed since that answer was written.
However, running eclipse with the -clean option in my old workspace did the trick for me. The way to do that in windows is to first find the directory where eclipse.exe lives. You can go to the start menu and in the "search menus and files" bar, type eclipse. You should see the purple globe icon pop up under "Programs." Hover your mouse over it and it will tell you the directory it exists in.
Then... open "computer" or some other window from the start menu and from there navigate to the window where eclipse is. Click your mouse in the bar at the top where the directory is displayed (somewhere not on the text). That directory will highlight. Now type cmd. A black command window will open and you will be in the directory where eclipse is. At the command prompt (drum roll) type eclipse.exe -clean
eclipse will start. Make sure it is asking to go to your corrupted workspace and click OK.
Wait for it and soon you will know if your workspace has been uncorrupted. Yay!
“java was started but returned exit code = -805306369” caused by Eclipse´s currupted workspace, I solved my problem with this 4 steps:
1) claose the eclipse.
2) Kill the adb from task manager.
3) Start your eclipse and by default it will create a workspace or start with new workspace.
4) Go to File -> Switch Workspace, choose your original workspace.
In my case, it is a work laptop, so pretty secure SOE
64 bit Win 7.
Unzipped Eclipse MARS onto a folder on "C" drive
Install failed consistently with Java error code -805306369
Created a separate folder on 'C' drive for workspace, granted
everyone full-control and that fixed it!!
I got same issue when opening files using shortcut - Ctrl+Shift+R.
I got it resolved by disabling "Automatic Updates".
Steps to disable automatic update in eclipse (helios): Windows >> Preference >> Install/Update >> Automatic Updates. Disable "Automatically find new updates and notify me".
How I managed to get mine working. I used a combination of the solutions above. It works for me.
Step 1: Change your workspace to some other names e.g. change it from workspace to workspace1.
Step 2: Access your eclipse and stop automatic updates (provided that you could access after changing your workspace)
Step 3: Exit your eclipse with workspace1
Step 4: Start your eclipse with former workspace by entering eclipse.exe -clean (if you are using others then use e.g. MuleStudio.exe -clean)
In conclusion, using a combination of solutions such as changing workspace, stop automatic updates and -clean work for me. Try it yourself.

Launch and debug a single script in PyDev

I am a beginner in using Eclipse and PyDev (Aptana Studio 3). I am not used to and i don't understand the workflow in such big IDEs as Eclipse.
I have a simple task: i have a simple Python script, which i want to open and run in Eclipse, having its output in Eclipse console. Or debug it.
Until now i used another IDE called Eric4, which allowed me to do what i want - open a file and run immediately, without creating a project or setting up launch configurations.
Is this possible in Eclipse, or i have to create a project for each file i want to run or debug? I want to understand how it works.
I guess i understand that creating a project is needed at least for settings up the paths (PYTHONPATH), but if it's a single script - somehow to use by default the current directory?
For example i have a folder called snippets where i keep a lot of python scripts which demonstrate some functionality. How do i open these files one by one and run them?
Most of my coworkers launch python scripts in a separate console - python my_scipt.py.
You need to have at least one project with the configuration you want (i.e.: syntax type, interpreter), then, open the file you want to run and press F9.
If it's an external file -- i.e.: a file that's not under a project in Eclipse -- it'll ask you to associate a project with the launch to get the needed information for the launch, but the file doesn't really have to be in the project (note that you can drag external files from your filesystem into Eclipse to open them).
I suggest you follow the steps on the getting started: http://pydev.org/manual_101_root.html (it guides you to configuring PyDev and explains how to do a run/debug session).

System.getProperty("user.dir") anomaly in Eclipse

In my current project settings, I have configured Eclipse to place the compiled .class files in the /bin directory.
My puzzle is that, when I run the application via the IDE and get it to print the current working directory (System.out.println(System.getProperty("user.dir")) I expect the console output to be /bin - instead the value printed is the projectRoot folder (without the /bin suffix).
If I were to navigate to the /bin folder directly, and execute my java class, the current working directory is printed as I expect it to be. What I would like is the Eclipse IDE to behave similarly.
Any ideas as to why I am observing this disparity? I have gone through many project build settings, but cannot seem to find anything that would cause this anomaly.
Kind regards,
Dinuk
In Eclipse, the working directory defaults to the project directory.
You can change this in the run properties
(Project->Properties->Run/DebugSettings->Edit->Arguments tab, at the bottom of the page).
Edit: Actually, the easiest way to get to it is Run->Open Run Dialog->Arguments tab.
It's been a while since I used Eclipse.
From an example of Eclipse Setup New Project
alt text http://apps.sourceforge.net/mediawiki/sprite2d/nfs/project/s/sp/sprite2d/a/ae/EclipseNewProjectDebugArguments.jpg