「Netbeans」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(→‎トラブルシューティング: 記事を差し替え)
96行目: 96行目:
 
tmpfs パーティションが小さい場合、maven のインデックスが展開できないという問題が発生することがあります (展開ができなくてもダウンロードは続行されます)。この問題を解決するには {{Ic|netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.dpiaware=true -J-Dsun.zip.disableMemoryMapping=true -J-Djava.io.tmpdir=/path/to/tmp/dir"}} を {{ic|netbeans.conf}} ファイルの末尾に追加してください。
 
tmpfs パーティションが小さい場合、maven のインデックスが展開できないという問題が発生することがあります (展開ができなくてもダウンロードは続行されます)。この問題を解決するには {{Ic|netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.dpiaware=true -J-Dsun.zip.disableMemoryMapping=true -J-Djava.io.tmpdir=/path/to/tmp/dir"}} を {{ic|netbeans.conf}} ファイルの末尾に追加してください。
   
=== OpenJDK Sun の JDK ===
+
=== Wrong Directory for JDK/JRE ===
Netbeans 7.0-1 は OpenJDK で絶対に動作するとは限りません。複数の問題が報告されています:
 
* 起動 - ときどき、netbeans が起動しないことがあります。
 
* インストール - netbeans に含まれている .sh スクリプトでウィザードが起動しません。
 
* JavaFX モジュールは動作しません ({{Bug|29843}} を参照)。
 
   
  +
It might be that after installation, {{ic|netbeans_jdkhome}} is set incorrectly:
=== Glassfish サーバー - Can`t download Glassfish server I/O Exception ===
 
新しい Glassfish サーバーを追加しても、サーバーをダウンロードすることができず、Netbeans が以下のように返す場合:
 
I/O Exception: http://java.net/download/glassgish/3.0.1/release/glassfish-3.0.1-ml.zip
 
   
  +
{{hc|/usr/share/netbeans/etc/netbeans.conf|2=
解決方法:
 
  +
''[...]''
* 公式サイトから GlassFish Server Open Source Edition を手動でダウンロードしてください。リンクは http://download.java.net/glassfish/3.0.1/release/glassfish-3.0.1-ml.zip です。
 
  +
netbeans_jdkhome="/home/aur/aur-netbeans-cpp/pkg/netbeans-cpp/usr/share/netbeans/bin/jre" (example)
* どこかに zip を展開してください。
 
  +
''[...]''}}
   
  +
Just comment out this line; ''netbeans'' will find the proper path on startup. Since {{ic|netbeans.conf}} might be overwritten during an update, this procedure might need to be done again after an update, or you put {{ic|netbeans_jdkhome}} into the configuration file in your home directory (see above).
=== Netbeans と kwallet を統合 ===
 
   
  +
=== Plugin installation fails due to lack of unpack200 ===
Netbeans にパスワードを保存しなくてはならないときがあります。パスワードを kwallet に保存することが可能です。Netbeans wiki の [http://wiki.netbeans.org/FaqMasterPasswordDialog こちらの記事] を見て下さい。
 
   
  +
The unpack200 plugin was removed in [[JDK]] version 14, causing plugin installation in Netbeans to fail. As a workaround, one can set {{ic|netbeans_jdkhome}} in {{ic|/usr/share/netbeans/etc/netbeans.conf}} to an earlier JDK version. After plugin installation, you can return to the default JDK, but this will have to be repeated for each plugin update.
ただし、{{AUR|qtchooser}} をインストール・設定して netbeans が qdbus コマンドを使えるようにする必要があります:
 
$ ln -s /etc/xdg/qtchooser/4.conf ~/.config/qtchooser/default.conf
 
 
フォーラムの [https://bbs.archlinux.org/viewtopic.php?pid=1374434#p1374434 議論] も参照。
 

2024年5月8日 (水) 18:57時点における版

Netbeans は Java, JavaScript, PHP, Python, Ruby, Groovy, C, C++, Scala, Clojure などの言語で開発するための統合開発環境 (IDE) です。

Wikipedia より:

"NetBeans IDE は Java で書かれており Windows, Mac OS, Linux, Solaris など互換性がある JVM がインストールされている環境ならどこでも動作する。Java による開発には JDK が必須だが、他のプログラミング言語の開発では必要ない。"

インストール

netbeans パッケージをインストールしてください。

ヒントとテクニック

ノート: グローバルな netbeans.conf (/usr/share/netbeans/etc/netbeans.conf) はパッケージのアップデートで上書きされます。設定を変更するときはローカルの netbeans.conf (~/.netbeans/<ver>/etc/netbeans.conf) に追加してください (etc ディレクトリと .conf ファイルを作成する必要があります)。
  • ローカルの netbeans.conf の設定はグローバルな netbeans.conf の設定を上書きします。
  • コマンドラインオプションは両方の設定ファイルの設定を上書きします。

Preserving configuration changes

ノート: The global /usr/etc/netbeans.conf will be overwritten during updates. To keep changes, add them to your local ~/.netbeans/version/etc/netbeans.conf (you will need to create the etc directory and the .conf file).
  • Settings in local version of netbeans.conf override the same settings in the global copy of the file.
  • Command-line options override settings in either of the configuration files.

Another alternative is to use a pacman フック that modifies the system-wide configuration file. For example:

/etc/pacman.d/hooks/10-netbeans.hook
[Trigger]
Type = Path
Operation = Install
Operation = Upgrade
Target = usr/etc/netbeans.conf

[Action]
Description = Updating netbeans.conf
When = PostTransaction
Exec = /usr/bin/sed -i -E 's/netbeans_default_options="(.*)"/netbeans_default_options="\1 -J-Dawt.useSystemAAFontSettings=on -J-Dswing.aatext=true --fontsize 15"/g' /usr/etc/netbeans.conf

Netbeans のフォントのアンチエイリアス

Netbeans 個別の設定

netbeans.conf ファイルの 'netbeans_default_options' 行に -J-Dswing.aatext=TRUE -J-Dawt.useSystemAAFontSettings=on を追加してください。

Java 全体の設定

Java#フォントレンダリングを改善するを見て下さい。

ルックアンドフィール

Netbeans のルックアンドフィールを変更するには、Tools>Options>Appearance>Look and Feel を開いて下さい。

ダークなルックアンドフィールを追加するには Tools>Plugin>Available Plugins から Dark Look And Feel Themes プラグインをインストールしてください。

Apache Tomcat Servlet コンテナの統合

Netbeans の中から Tomcat で実行しているウェブアプリケーションをデバッグすることができます。Netbeans と Tomcat は標準の Arch パッケージを使います。このセクションでは tomcat7 を対象としていますが、リポジトリにある全てのバージョンの Tomcat で利用できます。

  • まず使用したいバージョンの Tomcat をインストールしてください。例: pacman -S tomcat7 (Tomcat を参照)。
  • /etc/tomcat7 の設定ファイルを編集して Netbeans によるデバッグを行う場合、ローカルコピーを作成して、そちらを使用することが推奨されます。その場合、システムサービスとして Tomcat を動作させつつ、デバッグ用に別のインスタンスを作成することが可能です:
    • ローカルの設定ファイルのディレクトリを選択・作成してください。例: ~/.tomcat7
    • /etc/tomcat7/~/.tomcat7/conf にコピーします。例: sudo cp -r /etc/tomcat7 ~/.tomcat7/confsudo chown -R $(id -un):$(id -gn) ~/.tomcat7
    • Tomcat のユーザーとパーミッションファイルを編集して Netbeans が必要な情報を追加できるようにします。~/.tomcat7/conf/tomcat-users.xml を編集して以下のようにユーザーとロールの情報を全て削除してください:
<?xml version='1.0' encoding='utf-8'?>
 <tomcat-users xmlns="http://tomcat.apache.org/xml"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
               version="1.0">
 </tomcat-users>
  • ローカル設定から "manager" アプリにアクセスできるようにしてください: mkdir ~/.tomcat7/webappsln -s /var/lib/tomcat7/webapps/manager ~/.tomcat7/webapps/manager
  • 一時ディレクトリを作成: mkdir ~/.tomcat7/temp
  • 必要なら、~/.tomcat7/conf/server.xml を編集して Tomcat が動作するポートを変更します。
  • 残念ながら /etc/tomcat7/server.xml ファイルを読み込めるようにしないと Netbeans は上手く動作しません。一時的に sudo chmod 644 /etc/tomcat7/server.xml を実行して、後で戻してください。

そして Netbeans で以下を設定:

  • "Tools>Servers>Add Server" から Apache Tomcat を選択して "Next" をクリック。
  • "server location" に、/usr/share/tomcat7 と指定。
  • "Use Private Configuration Folder (Catalina Base)" にチェックを入れて ~/.tomcat7 ディレクトリのフルパスを記入。Netbeans は ~ を認識しないため、フルパスで指定する必要があります。
  • 最後に、ユーザー名とパスワードを記入します。"Create user if it does not exist" にチェックを入れてください。これで Netbeans が設定され tomcat-users.xml ファイルにユーザー情報を追加されます。

Tomcat のローカルインスタンスはログを /var/log/tomcat7 ではなく ~/.tomcat7/logs に出力します。

Integrate Netbeans with KWallet

Netbeans may need to store some passwords. It can do that in KWallet. See this article in the Netbeans wiki.

However, you need to install and configure qtchooserAUR[リンク切れ: package not found] so that netbeans can find the qdbus command:

$ ln -s /etc/xdg/qtchooser/4.conf ~/.config/qtchooser/default.conf

See forum discussion [1].

Integrate Netbeans with GNOME-Keyring

Install libgnome-keyring.

トラブルシューティング

tmpfs が小さい場合の Maven の問題

tmpfs パーティションが小さい場合、maven のインデックスが展開できないという問題が発生することがあります (展開ができなくてもダウンロードは続行されます)。この問題を解決するには netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.dpiaware=true -J-Dsun.zip.disableMemoryMapping=true -J-Djava.io.tmpdir=/path/to/tmp/dir"netbeans.conf ファイルの末尾に追加してください。

Wrong Directory for JDK/JRE

It might be that after installation, netbeans_jdkhome is set incorrectly:

/usr/share/netbeans/etc/netbeans.conf
[...]
netbeans_jdkhome="/home/aur/aur-netbeans-cpp/pkg/netbeans-cpp/usr/share/netbeans/bin/jre" (example)
[...]

Just comment out this line; netbeans will find the proper path on startup. Since netbeans.conf might be overwritten during an update, this procedure might need to be done again after an update, or you put netbeans_jdkhome into the configuration file in your home directory (see above).

Plugin installation fails due to lack of unpack200

The unpack200 plugin was removed in JDK version 14, causing plugin installation in Netbeans to fail. As a workaround, one can set netbeans_jdkhome in /usr/share/netbeans/etc/netbeans.conf to an earlier JDK version. After plugin installation, you can return to the default JDK, but this will have to be repeated for each plugin update.