Hello good people of Stack Overflow, I have come with yet another question for your bountiful knowledge to answer. I am having a problem using eclim, a program that integrates the features of eclipse for java development into the Vim editor.
I am unable to create a project using the syntax defined on eclim.org, which is this vim command, ":ProjectCreate /path/to/dir -n java". I am typing this like this, ":ProjectCreate /home/username/Java -n java", where username is my username. The error I get is,
Java Model Exception: Java Model Status [Java does not exist]
while executing command (port: 9091): -command project_create -f "/home/username/Java" -n java
This led me to test if Java was installed on my system, using java -version. The output is,
java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.1) (6b22-1.10.1-0ubuntu1)
OpenJDK Server VM (build 20.0-b11, mixed mode)
So I had Java installed, and I believe that is the OpenJDK version that is not used in my eclim installation. The version I specified is Java 1.6.0_24 of the sun Java JDK. That's beside the point though, as I do have Java installed.
So that's what led me to you. One last thing I would like to add though. I am using a headless server to run the eclim server in the background. This is through Xvfb, and is also detailed on eclim.org. I don't believe that is causing the problem, but I just thought it would be handy to throw in. As always, thanks for the help that will doubtless be provided.
I have done further testing and my original comment was not the correct reason. The real problem, was that I already had a directory at ~/Java. That tried to execute that directory for the project, which it could not do.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
My question looks similar to java-comand-works-but-not-javac but its different from the way that I deliberately had removed java bin directory from "path" variable and "JAVA_HOME" so that "java" and "javac" shouldn't be executed without giving full path to "javac" or "java".But still "java" is getting executed. For "javac" it is throwing 'javac' is not recognized as an internal or external command,
operable program or batch file.
But for "java" it is showing C:\Users\Nandi_Gaurav>java -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)
I want to know the reason. I am using "Windows-7" .
If the problem is that java running when you don't expect it to1, open up a cmd window and execute:
C:\USERS\Nandi_Gaurav\Documents>where java
C:\Windows\System32\java.exe
You'll almost certainly see that there's one installed in the Windows system directory.
That's why it's still executing even though you think you've removed it from the path.
If you really want to get rid of it, either delete it (assuming it's still available in the JRE/JDK directory) or rename it to something like nojava.exe.
Whatever you do, don't remove c:\windows\system32 from your path, that'll cause all sorts of issues :-)
1 Your problem may also be that javac is not running, in which case the JDK may not be installed. However, based on your question, that doesn't seem to be the issue - you're more concerned about things running when you've tried to disable them, rather than with things not running when they should be.
Java may be executed from the JRE that is installed in another path of your system.
Javac is part of the JDK, so you should install it, and set the appropriate paths.
You need to install Java Development Kit (JDK) which provides javac to compile your java code. You have the Java Runtime Environment (JRE) which is mainly for running java programs.
This question may help: javac : command not found
I think your 'Path'-variable is only used for javac.
Java-configuration in windows can be found here:
Explanation on java.com
Most probable issue could be that you are using JRE instead of JDK.
When you download java you can get it either as jre(Java Runtime Environment) or jdk(Java Development Kit) .
If you just want to run java programs on a machine , install JRE.
if you want to develop , compile and run a java program install JDK.
Both can be downloaded from oracle.Link for JDK 1.6
http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR
I'm using a BeagleBone Black that runs Debian (the latest version that the BeagleBone website provides a link for, I believe) and I recently installed Java on it. Every time I boot the board I must set the PATH for Java again as shown below.
root#beaglebone:/etc/init.d# java -version
-bash: java: command not found
root#beaglebone:/etc/init.d# export PATH=$PATH:/bin/jdk1.7.0_60/bin
root#beaglebone:/etc/init.d# export JAVA_HOME=/bin/jdk1.7.0_60
root#beaglebone:/etc/init.d# java -version
java version "1.7.0_60"
Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot(TM) Client VM (build 24.60-b09, mixed mode)
root#beaglebone:/etc/init.d#
I wanted to write a script to set up java during start-up and then run some java program. So I wrote a script "helium_startup.sh" and put it in init.d, the script looks like this:
export PATH=$PATH:/bin/jdk1.7.0_60/bin
export JAVA_HOME=/bin/jdk1.7.0_60
I haven't wrote the program that I would like to run here yet, but I think I could place a line to run it right after these two lines, right? Then I use update-rc.d to create the links:
root#beaglebone:/etc/init.d# update-rc.d helium_startup.sh defaults
update-rc.d: using dependency based boot sequencing
insserv: warning: script 'helium_startup.sh' missing LSB tags and overrides
I believe that the warning doesn't affect anything? I checked /etc/rc5.d to verify that one of the links was made:
root#beaglebone:~# cd /etc/rc5.d
root#beaglebone:/etc/rc5.d# ls
README S01sudo S03loadcpufreq S04wicd
S01boot_scripts.sh S01xrdp S03rsync S05saned
S01bootlogs S02apache2 S03ssh S06rc.local
S01capemgr.sh S03acpid S03udhcpd S06rmnologin
S01hostapd S03cron S04avahi-daemon
S01motd S03dbus S04cpufrequtils
S01rsyslog S03helium_startup.sh S04lightdm
And, the links do appear to be made for each of the run levels. Then I reboot the Beaglebone (I've tried doing it by "reboot", unplugging it, and pressing power button) and attempt to check the version of java:
root#beaglebone:/etc/rc5.d# java -version
-bash: java: command not found
And it fails. I'm new to Debian (and Linux in general) and this is my first time using the BeagleBone Black, I'm not sure what the issue is. I also tried putting the 2 lines to set the PATH for java in /etc/rc.local, and that didn't work either.
Any help would be greatly appreciated.
-Brandon
You can't set an environment variable (PATH) permanently in an init script. The appropriate place would be a script in /etc/profile.d
I'm setting up an Ubuntu VM to experiment with Clojure. In the Getting Started guide for Clojure, it shows running a java command. which java in my vm doesn't find anything.
I know nothing about Java. Tutorials for installing Java talk about the runtime environment, the SDK, etc.
What do I actually need in order to run Clojure?
Just the Runtime Environment
To run the REPL, all I needed was the Java Runtime Environment, which I installed with sudo apt-get install openjdk-7-jre.
A java program that does frequent swing/awt painting animation (but nothing more advanced than g.fillOval(...)) runs at a consistent 60fps in Netbeans, and at about 6fps when ran in Eclipse or executed as a jar file from a unix terminal. The program was developed in Netbeans and is run-of-the-mill desktop application (not webstart or japplet or ...). This is occurring in Ubuntu 10 with java 1.6. How is this possible?
$ java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)
Set the default jvm to the sun version, and outputed the jvm used by netbeans and the unix terminal, which was the same for both:
java.runtime.name=Java(TM) SE Runtime Environment, sun.boot.library.path=/usr/lib/jvm/java-6-sun-1.6.0.22/jre/lib/i386, java.vm.version=17.1-b03, java.vm.vendor=Sun Microsystems Inc.
However, this didn't make any difference as there is still a significant frame rate discrepancy. Is there some other factor that could be at play here?
One of possible reasons may be that NetBeans can use one JVM, and Eclipse and terminal "java" command can use another. Look into what platform NetBeans uses for your project, and compare it with Eclipse.
Also there can be something with arguments you passed to JVM. Check that too.
In Ubuntu there's a very handy utility. Try this:
sudo update-java-alternatives -s java-6-sun
in shell. It may output some errors...
update-alternatives: error: no alternatives for mozilla-javaplugin.so.
update-alternatives: error: no alternatives for xulrunner-1.9-javaplugin.so.
update-alternatives: error: no alternatives for mozilla-javaplugin.so.
update-alternatives: error: no alternatives for xulrunner-1.9-javaplugin.so.
That's only a problem with java plugin for Firefox. You may ignore this. If you have any other problem, than check which java you've got installed by issuing:
sudo update-java-alternatives -l
Or, you may use the interactive version:
sudo update-java-alternatives --config
(... this one I haven't tested).
If for any reason You don't have Sun's JDK listed post a comment.
EDIT
Are you using hardware acceleration? Try adding this JVM property:
-Dsun.java2d.opengl=True
To see details you might also use:
-Dsun.java2d.trace=log
Consult OpenGL acc for more details.
I am trying to get remote debugging working with Java on Solaris OS. Following is what I have tried-
I have a Java class called TestP which has the main method.
When I try
java -classpath . TestP
the program works fine. But when I try adding the debug parameters to the JVM-
java -Xdebug -Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=n -classpath . TestP
It fails giving this error-
UTF ERROR ["../../../src/solaris/npt/utf_md.c":49]: Failed to complete iconv_open() setup
Can anyone please help me on figuring out why this error is coming up?? The above works fine on my Linux box.
Java version on Solaris:
Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
Java HotSpot(TM) Client VM (build 14.1-b02, mixed mode)
Java version on Linux:
java version "1.6.0_0"
OpenJDK Runtime Environment (IcedTea6 1.5) (fedora-20.b16.fc10-i386)
OpenJDK Server VM (build 14.0-b15, mixed mode)
Hmm... This seems to be a known Solaris (not specific to Solaris 10) issue with Java 6, not a Java issue (see this thread).
Someone has successfully applied a workaround (see this blog post) from a Sun guy, Jeff Moguillansky, but I wouldn't recommend it and rather consider searching sunsolve for a patch as indicated on Sun's forums.
Look at this one: http://sunsolve.sun.com/search/document.do?assetkey=1-1-6586755-1 (you'll need a Sun Online Account with a valid Support Contract or Software Subscription).
Using truss I found out that the process was looking for /usr/lib/iconv/geniconvtbl/binarytables/UTF-8%646.bt and 646%UTF-8.bt, so I just copied ISO8859-1%ISO646.bt to UTF-8%646.bt and ISO646%ISO8859-1.bt to 646%UTF-8.bt (yes, it is "646", not "ISO646"!)
This is of course a very ugly workaround and I have no idea if it has any negative effects on the JVM, but at least it starts the JVM without aborting. (I did this on OpenSolaris 2009.06, btw)
If Pascal Thivent is right, then you may want to try running OpenSolaris (either on a blank machine or in a vm) and see if the problem is also there. If not, then consider using that version for now if possible.