English 中文(简体)
页: 1
原标题:unable to run javac on Ubuntu [closed]
Closed. This question is off-topic. It is not currently accepting answers.

。 因此,在Stack Overflow的

Closed 11 years ago.

我试图在乌兰巴托码头上 run。 但我得到以下信息:

 $ javac
 The program  javac  can be found in the following packages:
 * openjdk-6-jdk
 * ecj
 * gcj-4.4-jdk
 * gcj-4.6-jdk
 * gcj-4.5-jdk
 * openjdk-7-jdk
 Try: sudo apt-get install <selected package>

jdk已经安装,并运行sudo aptget set openjdk-6-jdk:0 升级,0个新装置,0个去除,322个未升级。

我的jdk安装在S/usr/lib/jvm/java-6-open-jdk;Im能够编辑和操作一个ec方案。 但是,在使用终点站时,我会遇到上述问题。

最佳回答

<代码>javac binary (及很可能是其他java binaries) is/are not in theiruser s $PATH environment changing. 您可以采取几种方式解决这一问题:

  1. /usr/lib/jvm/java-6-open-jdk/bin,加入用户$PATH/code> 您可以通过在用户<代码>bash_profile<>/code>上添加一条与以下内容类似的线来做到这一点:

    <代码>出口 PATH=${PATH}:/usr/lib/jvm/java-6-open-jdk/bin

    您不得不重新召开开幕会议,以便生效。

  2. 创建与已经是你道路一部分的一些名录(如<代码>/usr/bin)的标志性链接

    sudo ln -s /usr/lib/jvm/java-6-open-jdk/bin/java /usr/bin/
    sudo ln -s /usr/lib/jvm/java-6-open-jdk/bin/javac /usr/bin/

    BTW:/usr/lib/jvm/java-6-open-jdk/bin还有其他若干可执行之处。 页: 1 你们可能想要使用的任何其他迫害者,也应得到类似的指挥。

  3. 直接在指挥线上使用完全合格的路线:

    $/usr/lib/jvm/java-6-open-jdk/bin/javac

Update:

显然,这个问题存在一种棘手但因班图特而异的解决办法。 http://manpages.ubuntu.com/manpages/hardy/man8/update-java-alternatives.8.html

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...