JVM: could not open - java

Error - JVM - BlackBerry 9800
Simulator
--------------------------------------- JVM: could not open
C:\Users\Bayron.Tellez\Downloads\eclipse-java-helios-win32\eclipse\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.29\components\simulator\Java\net_rim_bis_lib.cod
My friend installed Eclipse with the Blackberry simulator. I'm assuming it was a portable installation because at no point we were prompted to install.
Now, he zipped it up and copied it to my machine when running I receive that error above. Obviously it's because it's trying to look for something on my friends directory. How can I change it to my path?
My path is:
C:\Eclipse\eclipse\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.29\components\simulator\Java\net_rim_bis_lib.cod
Where do I change this?

I would suggest not running eclipse from a copy of someone else's installation. This will probably contain lots of installation-specific files which are unlikely to match your machine.
Why not install it yourself, then install the Blackberry Java Developer plugin? It's available at http://na.blackberry.com/eng/developers/javaappdev/devtools.jsp

You can change the early installed paths of all .cod files from xml.manifest
[Eclipse Installed Path]\plugins\net.rim.ejde.componentpack7.1.0\components\simulator\[BlackBerry simulator version].xml.manifest
Eg:
C:\Program Files\Eclipse\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.30\components\simulator\9800.xml.manifest
Then remove the [BlackBerry simulator version].xml.manifest.bin file.
Now it should be work.

You may also want to check file Settings.rc,
found in the folder
PATH\plugins\net.rim.ejde.componentpack4.6.1_4.6.1.49\components\bin
first you have a path to your eclipse installation, and then corresponding Simulator you are trying to run.
hope this helps,

Use notepad++ to replace all occurrances of old directory into new directory in the eclipse directory.
Start the eclipse, and click clean simulator button.
That should be all.

Though it is not advisable to run a copy of eclipse, there is a very simple way for one to solve such a problem: it is by running the clean.bat file that is in the simulator folder of the specific component pack version folder. The path to that file would look like this: PATH\plugins\net.rim.ejde.componentpack[BlackBerry version]\components\simulator\clean.bat
I think that would do.
Still, installing a new version is the best option.

It will be better you install it yourself frsh rather than copying it from friends machine.
But you can give it a try.
Goto your eclipse\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.29 directory and check do on of these files contain this path:
plugin.properties
plugin.xml
META-INF/eclipse.inf
.options
Or else you could grep for problem path in your plugin directory and replace same with updated path.

This error occurse cause your simulator have previously loadded application. Removing them solve your problem.
How to remove installed Java programs on the simulator?
Quote from Reset and clean the blackberry simulator:
Are you sick of having a million icons on your BlackBerry simulator for every HelloWorld and demo project you have every tested? Try this to remove old programs from the simulator and start with a clean ribbon. From the command line browser to your rim jde directory, switch to the simulator sub directory and run clean.bat. This program takes longer than you would expect (about 30 seconds or so on my 3 ghz machine).
UPDATE
Also delete all [app name].cod|cso|debug|jar files from simulator folder Also make sure projects you don't want on simulator are not active and are not in build configuration.

Related

How to save Java Project from IntelliJ IDEA to Git repo so it will build on another PC after cloning?

I'm building a simple calculator app from a tutorial/class on Pluralsight (Java Fundamentals class), which starts with a Main.java file, and adds a class file later, MathEquation.java.
I created a Git repo to track my progress, and uploaded to Github: JavaFundamentalsClass. I used GitIgnore.IO to find a Java IntelliJ .gitignore file, and everything seemed to be working fine on the original PC I was using.
However, after switching over to a different PC, with a fresh install of IDEA, I cloned down the repo from Github, and found that the project would not build and/or run. I get this error:
"C:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.191-1\bin\java.exe" -Dfile.encoding=windows-1252 -jar ""
Error: Unable to access jarfile
Process finished with exit code 1
I suspect that there is something in the .gitigore file that is keeping some of the project, dependency, or build information from being saved in the repo that keeps IDEA from having all the info it needs to build and run the Main.java correctly.
Can anyone help? You should be able to download the project from the repo linked above in it's currently broken state, including the .gitignore file.
Additional Info
I wiped my repo clean and recloned and I forgot, originally it doesn't even give me the run button (it is grayed out). I had to do a procedure with "Add Configuration" from a search I did for that to show up to get the error above.
Also, I did install java from the OpenJDK, rather than oracle. I figured with Oracle cutting off commercial development maybe start the switch now as I'm learning, but maybe that's the issue (normal Java on my other PC).
It's working, but...
First thing - Intellij needs to know where Java is. It appears that if the SDK/JDK is not installed prior to Intellij, you will need to tell it where Java is after installing. Or if you use OpenJDK instead of Oracle Java SDK. You can do that at View/Open Library Settings, under Platform Settings / SDKs (select the JDK home path).
Then, after setting up Java, I am able to get everything working in Intellij IDEA if I find the Main.java file, right-click, and choose "Run main.main()". This runs the program okay, and also creates a Main configuration in the Run/Debug configuration area, and finally the "Run" button becomes available.
So I can get it working, but if I wipe all the files and clone it fresh from the remote repo, I have to go through running the Main.java file directly again to recreate the configuration.
So, this still doesn't answer my original question. Why doesn't this configuration get saved in the repo? What file is this information saved in? Is there something in the .gitignore file that is keeping this information from being saved to the repo?
Look like you have a different java version on your second machine.
First of all, check your java version
Update the configuration of your project, right now it pointing to java 1.8
https://github.com/LightCC/JavaFundamentalsClass/blob/master/.idea/misc.xml
I think it might be because of java not installed on the other PC you were trying. If it is installed just check whether the path mentioned has java executable file.
The first part is ensuring Java is setup, and that Intellij IDEA knows where Java is, per the other answers, comments, and addendums to the question.
The second part is setting up the run/debug configuration, per the "It's working but.." section of the question. This can be created automatically by right-clicking the file that has the main class to be run (usually Main()...), and selecting the "Run Main.main()" option (replacing Main and main() with the file and function which needs to be run)
The final piece is that to get the run/debug configurations to save to the repo, you either need to:
Share the workspace.xml file (i.e. make sure this is not in the .gitignore file). However, there is a lot of user-specific stuff in that file, so it should normally be excluded from the repo.
Or, edit the configuration and checkmark the "Share" box in the upper right-hand corner (just right of the "Name" field). This will put the configuration into a separate folder inside the .idea folder, which should not be excluded from the repo by .gitignore.

Opening a .jar in Ubuntu

While making a game, i moved from programming in windows to ubuntu for better usability. that aside, when in windows, using Desktop d = Desktop.getDesktop(); and using d.open(new File("file dir.jar"); and it worked in windows. but, when using ubuntu, it opens the jar in an archive manager. so my question is, how would i open the .jar to be executed? Any help would be great! thanks in advance!
Edit: it may be possible i installed java wrong... but i did it the way i found on google. if that is the case, any correction would be great :D
I see two ways:
1) add the jar you want to run to the program classpath and run it's main method.
2) using Runtime.exec() you can run anything you want, but you may lose platform independence
The archive manager is set as the default program to open .jar files. You will have to change it in Ubuntu's settings for default programs. You can right-click on the file you want to open and select to open it with your installed Java runtime environment, in the meantime.

Attaching a process to a debug session: empty process list

Windows xp sp3
Eclipse Junu with CDT
I've been trying to debug a JNI project using the process attachment feature.
At first, I fire the Java program, and then, when I fire the C program, I suppose to choose the javaw.exe process.
The tutorial I used for JNI debugging
The problam is, when I suppose to choose the right process, the process list seem to be empty:
Here is my debug configuration:
What can I do? Should I replace the debugger?
Thanks in advance,
Mark.
I encountered this problem using eclipse CDT plugin in Eclipse Juno on windows. Using sysinternals process monitor I discovered that eclipse was looking for a class file:
C:\Program Files\eclipse\plugins\org.eclipse.cdt.core.win32.x86_64_5.2.0.201209170703\org\eclipse\cdt\internal\core\win32\ProcessList.class
but not finding it (Eclipse is installed on my system in C:\Program Files\eclipse). The missing class file is present in the jar file:
C:\Program Files\eclipse\plugins\org.eclipse.cdt.core.win32_5.3.0.201209170703.jar
I am not sure why eclipse can't find the file in the jar. I copied the entire "org" directory tree out of the org.eclipse.cdt.core.win32_5.3.0.201209170703 jar into the file system. Having done that, eclipse can now find the file
C:\Program Files\eclipse\plugins\org.eclipse.cdt.core.win32.x86_64_5.2.0.201209170703\org\eclipse\cdt\internal\core\win32\ProcessList.class
(and other files in that jar) and the process pick list is now populated.
This didn't work for me. I was able to find the jar and extract the jar, but still got the same error.
I switch back to Eclipse v3.7 (Indigo) with CDT and everything works. Same GCC toolchain and project, all I did was change which version of eclipse I was using and the attach to process works fine. I'll report the bug to CDT team but Juno is really costing me some man hours (both for CPP and Java...)
Good luck other CDT users!
UPDATE:
I was able to get your workaround to work. I extracted the specified jar and it came out as a 'org' directory in the plugin folder. But really, it needed to be extracted in the directory/folder that has the same name as the Jar. This is strange...
Well, Juno+CDT is working again.. guess I shouldn't be such a hater ;-)

Netbeans 7.2 won't open on OS X

I installed Netbeans on OSX Mountain Lion running JDK 7. Everything was working fine. Then my machine for no reason crashed. After this I could no longer open Netbeans anymore.
If I try to start Netbeans from the commandline:
/Applications/NetBeans/NetBeans 7.2.app/Contents/MacOS/netbeans
Then it works fine. From there I can select Netbeans > About and confirm that my userdir and cachedir is:
User directory: /Users/<user>/Library/Application Support/NetBeans/7.2
Cache directory: /Users/<user>/Library/Caches/NetBeans/7.2
So, I deleted these directories and tried again, but alas, I can only start netbeans via the commandline.
Ideas appreciated...
Sounds to me like this is not a NetBeans problem at all, rather a problem with the bundle, such that OS X is not launching the app as it should.
To verify, I'd try opening NetBeans through Finder from the command line:
open -a "NetBeans 7.2.app"
This command will ask the system launcher to open the application as if you had clicked on the icon. In your case, it probably won't open. If this is true, then you know it's not something in your terminal environment that's allowing NetBeans to launch.
The next step that I would take would be to look at the package contents: examine /Applications/NetBeans/NetBeans 7.2.app/Contents/Info.plist for anything that seems amiss - this file is the information store that OS X looks for to see how to launch the package, what its icon is, etc... - in particular, I think you should look at the CFBundleExecutable value to see what command is used to launch the app. If it's not netbeans, you've found a big hint on what might be amiss: bundles are set up so that launchers should run bundle_dir.app/Contents/{platform}/{CFBundleExecutable_value}. Looking at CFBundleExecutable should show you if there's some other script used to launch the app than just running netbeans.
From this point, you'll have to do more digging, but hopefully this is enough information for you to get started tracking down how apps are launched from the OS X launcher. For more info and a better reference, check out this link, which is Apple's documentation for keys in Info.plist.
Finally, you should note that the launch information for all apps are heavily cached; I've heard that if you make a change to Info.plist, you have to rename the app bundle and name it back to have the changes picked up by the launcher.
Good luck!
Here's an idea: use Eclipse >=)
..but seriously, something got corrupted in Netbeans' metadata/cache data files. You cleared a couple of them but there may be others elsewhere.
Try comparing the launch command in your shortcut to what you're typing in the console. Are they the same?
To find the root cause, I would check the NetBeans logs, as detailed here
/Users/yourname/Library/Application Support/NetBeans/7.2/var/log/messages.log
And if that doesn't help, I'd archive your project(s) and put a clean install of NetBeans on your machine, and then import the archived project(s) back into NetBeans.

RCP's exec launcher can't find companion shared library on launch, but starts with click on org.eclipse.equinox.launcher_1.2.0.v20110502.jar

I'm building an Eclipse RCP application against Eclipse 3.7.1 and Java 1.6.
I'm also using Tycho to build, and have set up my RCP according to the Tycho tutorial from the EclipseCon 2011, to which I've stuck slavishly, apart from project names.
The application builds fine up until I get to Step 5 (adding a p2 repo, then adding a .product file. Well, it still builds fine, and everything is where it should be, but I cannot start the RCP by clicking on the .exe file from the repository in the workspace.
All I get is the old dreaded "The [RCP] executable launcher was unable to locate its companion shared library" error popup.
First of all I thought I might have set up the CLASS PATH incorrectly, but when I open a console and type javaw or java -version anywhere, it all works.
Also, when I go to the pluginsfolder in the p2 repository for the RCP in the workspace, and double-click on org.eclipse.equinox.launcher_1.2.0.v20110502.jar, the RCP starts, albeit without the splash screen.
This must surely mean my Java set up is correct, and it's not a class path problem?
I'm not sure where this problem might lie (I have a plugin, a feature, a product, a repository, and a parent package with the main pom), so if you let me know your suspicions where the error might come from, I'll be more than happy to post respective XML, build.properties, screenshots and what have you. Unless this is a common error with a common solution.
Many thanks in advance!
Oh yea: Windows 7 (64-bit), JDK and JRE both 64-bit as well, Eclipse EE 3.7.1 (I chose that because it contains the most plugins I'll need later by default).
UPDATE
I'm attaching my CLASS PATH Settings for reference.
User variables
CLASS PATH: C:\Program Files\Java\jdk1.6.0_30;.;
System variables
JAVA_HOME: C:\Program Files\Java\jdk1.6.0_30
Path: %JAVA_HOME%\bin;
UPDATE 2
When I let Tycho create a ZIP file in the p2 repository, and copy that from the repo to another location, unzip it and run the .exe, the application starts without problems. So I guess this query is partially solved, but I'd still be interested to hear why I wouldn't be able to start the application from the repository...
Today I came across the same issue. I guess you could find the solution here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=176084
In short, the problem in my case was, that the org.eclipse.equinox.launcher_1.2.0.v20110502.jar must be unpacked in the plugins folder under the folder name: org.eclipse.equinox.launcher_1.2.0.v20110502
... hope that helps!
In my case the error The [RCP] executable launcher was unable to locate its companion shared library was because my path was too long.
Same issue I was facing from yesterday. Today, I have changed path of project(git clone) and build it and able to run RCP executable.
I think this issue was because of path too long.

Categories

Resources