Emulator Trouble

Anyone tried the emulator yet? I am trying to install it and am having no luck. I have jdk 6U13 on my machine but the webstart application can’t seem to find it. I don’t really want to install an older version also. Is there a way I can point the installer at my JDK?
Edit: forgot to add- I am running Debian Lenny

Try setting your JAVA_HOME variable first. For example:


$ export JAVA_HOME=/path/to/jdk
$ javaws http://www.sunspotworld.com/SPOTManager/SPOTManager.jnlp

If that doesn’t work, try linking Lenny’s install location to the standard Java location (they’re generally different):


# mkdir -p /usr/java/
# ln -s /path/to/jdk/ /usr/java/latest

If that’s still not working, make sure you’ve really got the JDK installed and in your PATH:


$ javac -version

If you get “command not found”, then you might need to play with your PATH and verify you really installed (Sun’s) JDK.

If you still aren’t having luck, post the output of the following commands:


$ java -version
$ whereis java

Good luck!

I set my JAVA_HOME variable and that didn’t help. I made a direcotry for java in my /usr directory and linked it to my JDK. That didn’t do it either. I even added the path to my JDK direcly to my JDK’s directory and still nothing. Here is the output from the commands above.


$ javac -version
bash: command not found

$ java -version
Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
Java HotSpot(TM) Client VM (build 11.2-b01, mixed mode, sharing)

$whereis java
java: /usr/bin/java /etc/java /usr/share/java /usr/share/man/man1/java.1.gz

I am at a loss. I would say my JDK is not installed properly, but I use it with NetBeans and BlueJ quite a bit. I can compile those projects no problem. I also moved a project to another computer and had to install JDK6 U13 before the project would compile on that machine. I am pretty sure my JDK is up and running.

Check your NetBeans configuration (Tools > Java Platforms) for your real Java installation. Then, uninstall the JRE from the package manager, open up your ~/.bashrc in gedit/kwrite/whatever. Then add the following to the bottom:


export JAVA_HOME=/path/to/jdk/dir
export PATH=$PATH:$JAVA_HOME/bin

Save and logout/in.

If you’re still having issues, download Sun’s JDK from http://java.sun.com (not the RPM version). Save it in /usr/java, and execute it (the .bin installer) there (as root):


# sh whatever.bin

It should extract itself. Then modify the bashrc to change JAVA_HOME to /usr/java/newJavaInstall. Additionally, make sure you uninstall any Java packages via apt/synaptic/whatever to avoid path conflicts.

Good luck!

According to netbeans, my JDK is indeed JDK6 u13. I had to install that with the binary package last time. It is not in the repo’s yet. I can’t test the download manager now that my JRE has been uninstalled. My question on that is should I use the JRE in the repos or get the binaries and reinstall it?

Should be simple enough, as you’ve alread got the correct JDK installed. Just modify your PATH in ~/.bashrc to include your actual JDK’s bin directory, as shown in my last post (you can skip the JDK install). Verify everything is working by trying javac -version. Just remember to log out/in again to make the changes apply to the entire session.

All right. Here is what my screen looks like now.


javac -version
1.6.0_13

but I run the emulator for the manager and it says it can not execute a command (big file name so I am not putting it here). All it appears to be is a small temp file designed to be compiled so the program will know a compiler is installed. I don’t get it. I can find my copilier but the program can’t. I even tried using sudo to run the manager and still nothing. I don’t know if reinstalling my JRE would do this. I had to, though. I can not run webstart applications without a JRE installed.

Unfortunately Java installation has to be this complicated :-/
Installing through the system package manager is usually your best bet, unless (as with your case), the repos are outdated.

You should be able to get Java applets working by linking the mozilla plugin to your mozilla plugins directory:


$ mkdir -p ~/.mozilla/plugins
$ ln -s /usr/java/jdk1.6.0_13/jre/plugin/i386/ns7/libjavaplugin_oji.so ~/.mozilla/plugins

This also applies to non-mozilla browsers (konqueror, opera, etc) as its a generic directory for browser plugins.

You’ll probably have to add a file handler for .jnlp files to get webstart working. In KDE you can use “File Associations” panel in kcontrol (under KDE Components)/ systemsettings (under the “Advanced” tab). I’m not sure how to do this with GNOME/XFCE, but it’s probably similar:

Click Add, choose a category and name it “jnlp”. Then add the “.jnlp” extension and associate it with the “javaws” command (you’ll likely have to type this yourself)- /usr/java/jdk1.6.0_13/bin/javaws.

That should get things working for you. If all else fails, you can always run .jnlp files from the command line with:


$ javaws http://url/of/webstartapp.jnlp

Another option is to use alien to install the rpm version. The .bin for the RPM distribution of the JDK at least extracts the RPMs you’ll need to install (and fails when it attempts to install them), so you should be able to convert them to .debs:


# apt-get install alien
...
$ alien -i --to-deb anrpm.rpm anotherrpm.rpm ...

They should be installed automatically. The benefit to doing this is that (on my system at least) most of the file associations and configuration seems to be taken care of automatically.

I thoguht I uninstalled java6 in the package manager. Everything on my account said I did. When the package manager still complained that it couldn’t find my JDK, I logged into a different account and java6 was still there. I checked the package manager again and sure enought java6 is still selected. However, when I went to mark it for uninstallation, the manager tells me that OpenOffice will be removed also. I will try command line and see what Open office has to say. Thanks for all your help.

Not sure if this issue has been resolved yet, but I would like to post a few ideas as to why this might be happening.

By default Debian will try to use the OpenJDK for all java related activities in order to comply with their FSG (Free Software Guidelines). This many times will cause problems with application wanting the official compiler.

The reason that it says OpenOffice must be uninstalled is that the OpenOffice packages in the Debian Archives rely on an installed JRE, therefore apt will not let you remove the JRE.

I would say you should run these commmands to try resolve this problem:

“sudo aptitude reinstall sun-java6-jdk sun-java6-jre”

then

“sudo aptitude purge openjdk-6-jdk openjdk-6-ire”

If that doesnt help just go ahead and post back.

Hoping my knowledge as a Debian Maintainer comes in handy,
Luke Cycon