# ----------------------------------------------
# Author: [email protected]
# Before executing this script make sure
# you're in your home directory `cd $HOME`
#--------------------------------------------------
# -------------------------------------NOTICE------------
# APPLICABLE ONLY IN UBUNTU UNITY
# This script installs Jayatana for your JDKs
# It supposes you already have set your JAVA_HOME in ~/.bashrc
# You will be prompted to choose which JDK to set as Default
# (choose the corresponding index).
# In case you already installed jayatana and want to re-install,
# please uninstall then install again.
# ------------------------------------------------------
# -------------------------------------LICENSE--------------------
#Licensed under the GNU LGPL, Version 3.0 (the "License");
# you may not use this file except in compliance with the License
# ----------------------------------------------------------------
#JDKPATH=`echo $JAVA_HOME | sed -e 's/bash://g' | sed -e 's/Is a directory//g'`
#JDKPATH=eval "echo $JAVA_HOME"
JDKPATH=`echo $JAVA_HOME | grep [^*]`
USERHOME=`echo $HOME`
JAYATANADD="http://java-swing-ayatana.googlecode.com/svn/tags/1.2.4/jayatana"
# INSTALL
INSTALLCOM () {
sudo apt-get -y install openjdk-7-jdk libunity-dev libxt-dev gcc make ant subversion
sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
svn checkout $JAYATANADD
sudo ant install -buildfile $USERHOME/jayatana/build.xml -v
sudo ant config -v
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo ant install -Djava.home.7=/usr/lib/jvm/java-7-openjdk-amd64 -f $USERHOME/jayatana/build.xml -v -l $USERHOME/Desktop/jayatana-stall.log
sudo ant config -Djava.home.7=$JDKPATH -f ~/jayatana/build.xml -v -l $USERHOME/Desktop/jayatana-stall.log
}
# UNINSTALL
UNINSTALLCOM (){
sudo ant deinstall -buildfile $USERHOME/jayatana/build.xml -v
sudo ant deconfig -buildfile $USERHOME/jayatana/build.xml -v
sudo ant deconfig -Djava.home.7=$JDKPATH -f $USERHOME/jayatana/build.xml -v -l $USERHOME/Desktop/jayatana-stall.log
}
# DELETE Jayatana Folder created by subversion checkout
UNDIR() {
read -p "Delete Jayatana Folder too? Enter ( y ) to delete or ( n ) otherwise : " choice
if [ "$choice" = "y" ]; then mv $HOME/jayatana $HOME/.local/share/Trash/files/
elif [ "$option" = "n" ]; then echo"Jayatana Folder is kept by $USER";
echo "you can delete it later : ~/jayatana";
else echo "Jayatana Folder is kept by $USER , you can delete it later : ~/jayatana";
fi
}
# COMMON
COMMON() {
echo "$JDKPATH : is your default JDK. Version: "
echo `java -version`
}
eval COMMON;
read -p "Enter ( i ) to install or ( u ) to uninstall : " option
if [ "$option" = "i" ]; then eval INSTALLCOM
elif [ "$option" = "u" ]; then eval UNINSTALLCOM;eval UNDIR;
else echo "Aborted by $USER";
fi
exit 0;
这是目前一个开放的错误。
我建议订阅它以跟踪它的进展。(如何订阅)
该线程中提到的打开的错误是关于 Eclipse,它不使用许多 Java 应用程序使用的默认 Java GUI 工具包(Swing)(Eclipse 使用 SWT)。
因此,即使 Java 应用程序解决了特定的错误,我们也可能不会有 Unity 集成。
您可以通过安装 Jayatana 为实现 JMenubar 的任何基于 Java 的应用程序进行全局菜单集成:
cd ~/
bash path_to_the_newly_saved_script
按照说明操作(您需要互联网连接)。
#!/bin/bash
您可以在这篇文章中查看详细信息: Java 应用程序的 Ubuntu 全局菜单支持
对于ECLIPSE,这是不同的。包 ECLIPSE 在 libappmenu.so 库中被列入黑名单,因为它与全局菜单的集成在某种程度上被破坏了(菜单有时重复和无序)。EMACS23 也是如此(使用全局菜单时不会出现动态菜单)。所以他们被列入黑名单,直到开发人员提供全局修复。
有一个名为java-swing-ayatana的程序支持这一点。我不确定它是否适用于每个 java 应用程序。但它现在有一个 PPA 安装,所以它很容易。
在此之后,您可能需要重新启动会话。
可以从命令行运行的任何命令都可以添加到菜单中。
全局菜单项可以在 /usr/share/menu 中找到。您应该能够通过编辑现有条目来添加新条目。
可以通过右键单击面板上的应用程序项来添加个人条目。