com.sun.tools.javac.Main is not on the classpath

,

Ceritanya kembali membuka program Netbeans setelah lama “dianggurkan”. Karena deadline tugas semakn dekat, akhirnya dibuka juga itu program walaupun berat karena memori terbatas. Setelah berhasil kopi paste mentah-mentah contoh program dari internet, tiba-tiba terjadilah error seperti ini.

error

Pre-processing 1 file(s) into /home/hahn/Dokumen/java/contohJson/build/preprocessed directory.
post-preprocess:
preprocess:
pre-compile:
extract-libs:
do-compile:
Compiling 1 source file to /home/hahn/Dokumen/java/contohJson/build/compiled
/home/hahn/Dokumen/java/contohJson/nbproject/build-impl.xml:368: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "/usr/lib/java"
BUILD FAILED (total time: 0 seconds)

Dari hasil googling sebentar begini ternyata caranya.
1. Buka Tools > Options. Lihat bagian Miscellaneous

2. Lihat bagian Classpath. Jika masih kosong, klik Add JAR/ZIP
3. Buka /usr/lib/java/lib/. Klik tools.jar


4. Coba Run lagi. Jika hasilnya seperti di bawah, berarti Anda layak dapat bintang.

Sumber: Sini


Ada komentar?

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: