LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   jdk portecle error (https://www.linuxquestions.org/questions/slackware-14/jdk-portecle-error-4175561020/)

sababa.sababa 12-09-2015 01:26 AM

jdk portecle error
 
Hi,

I've installed portecle and the latest version of jdk through slackbuilds.org, but when I try to start portecle I get this:

Code:

Exception in thread "main" java.lang.NoClassDefFoundError: net.sf.portecle.FPortecle
  at java.lang.Class.initializeClass(libgcj.so.14)
Caused by: java.lang.ClassNotFoundException: java.security.KeyStore$ProtectionParameter not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:portecle.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
  at java.net.URLClassLoader.findClass(libgcj.so.14)
  at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.14)
  at java.lang.ClassLoader.loadClass(libgcj.so.14)
  at java.lang.ClassLoader.loadClass(libgcj.so.14)
  at java.lang.Class.initializeClass(libgcj.so.14)

Thanks in advance for help!

phenixia2003 12-09-2015 02:14 AM

Hello,

Quote:

Originally Posted by sababa.sababa (Post 5461753)
Hi,

I've installed portecle and the latest version of jdk through slackbuilds.org, but when I try to start portecle I get this:

Code:

Exception in thread "main" java.lang.NoClassDefFoundError: net.sf.portecle.FPortecle
  at java.lang.Class.initializeClass(libgcj.so.14)
Caused by: java.lang.ClassNotFoundException: java.security.KeyStore$ProtectionParameter not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:portecle.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
  at java.net.URLClassLoader.findClass(libgcj.so.14)
  at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.14)
  at java.lang.ClassLoader.loadClass(libgcj.so.14)
  at java.lang.ClassLoader.loadClass(libgcj.so.14)
  at java.lang.Class.initializeClass(libgcj.so.14)

Thanks in advance for help!

It seems that you run portcecle with gcc/gcj, not with oracle/java. There's something wrong with your java installation, or the PATH is not correctly set. Keep in mind that, once you have installed java, you need to do one of the following to ensure the PATH is correctly set :

1. disconnect/reconnect
2. run the commnand :
Code:


. /etc/profile.d/jdk.sh

Important: Do not forget the dot (followed by a space) in front of the command above.

If this does not solve the problem, post the output of the commands:

Code:

$ echo $PATH
$ ls -l /etc/profile.d/jdk*
$ ls -l /var/log/packages/*jdk*

--
SeB

sababa.sababa 12-09-2015 02:42 AM

Thanks for the reply! I tested your suggestion, but it didn't work. Here are the command outputs:

Code:

bash-4.2$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/java/bin:/usr/lib/java/jre/bin:/usr/lib/openjdk/bin:/usr/lib/openjdk/jre/bin:/usr/lib/qt/bin:/usr/share/texmf/bin
bash-4.2$ ls -l /etc/profile.d/jdk*
-rwxr-xr-x 1 root root 143 Dec  9 08:36 /etc/profile.d/jdk.csh
-rwxr-xr-x 1 root root 146 Dec  9 08:36 /etc/profile.d/jdk.sh
bash-4.2$ ls -l /var/log/packages/*jdk*
-rw-r--r-- 1 root root 141353 Dec  9 08:38 /var/log/packages/jdk-8u65-i586-1_SBo
-rw-r--r-- 1 root root  58100 Dec  9 10:29 /var/log/packages/openjdk-7u79b14-i486-1_SBo


phenixia2003 12-09-2015 03:02 AM

Hello,

Quote:

Originally Posted by sababa.sababa (Post 5461778)
Thanks for the reply! I tested your suggestion, but it didn't work. Here are the command outputs:

Code:

bash-4.2$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/java/bin:/usr/lib/java/jre/bin:/usr/lib/openjdk/bin:/usr/lib/openjdk/jre/bin:/usr/lib/qt/bin:/usr/share/texmf/bin
bash-4.2$ ls -l /etc/profile.d/jdk*
-rwxr-xr-x 1 root root 143 Dec  9 08:36 /etc/profile.d/jdk.csh
-rwxr-xr-x 1 root root 146 Dec  9 08:36 /etc/profile.d/jdk.sh
bash-4.2$ ls -l /var/log/packages/*jdk*
-rw-r--r-- 1 root root 141353 Dec  9 08:38 /var/log/packages/jdk-8u65-i586-1_SBo
-rw-r--r-- 1 root root  58100 Dec  9 10:29 /var/log/packages/openjdk-7u79b14-i486-1_SBo


You have both jdk and openjdk installed, which may cause conflict. Uninstall them, reinstall only oracle/jdk (1) and run portecle with this configuration.

(1) to ensure the PATH is correctly set once you have installed the jdk, do not forget to disconnect/reconnect or run the commands below:
Code:

$ . /etc/profile.d/jdk.sh

If that fails, post the output of commands:
Code:

$ ls -l /etc/profile.d/*jdk*
$ ls -l /var/log/packages/*jdk*
$ echo $PATH
$ whereis java
$ java -version

--
SeB

sababa.sababa 12-09-2015 06:21 AM

I did the following:

Code:

su
asbt -R openjdk # removing
asbt -R jdk # removing
asbt -B jdk # building
asbt -I jdk # installing
cd root
. /etc/profile.d/jdk.sh
portecle

and still get
Code:

Exception in thread "main" java.lang.NoClassDefFoundError: net.sf.portecle.FPortecle
  at java.lang.Class.initializeClass(libgcj.so.14)
Caused by: java.lang.ClassNotFoundException: java.security.KeyStore$ProtectionParameter not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:portecle.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
  at java.net.URLClassLoader.findClass(libgcj.so.14)
  at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.14)
  at java.lang.ClassLoader.loadClass(libgcj.so.14)
  at java.lang.ClassLoader.loadClass(libgcj.so.14)
  at java.lang.Class.initializeClass(libgcj.so.14)

So I did:
Code:

bash-4.2# ls -l /etc/profile.d/*jdk*
-rwxr-xr-x 1 root root 143 Dec  9 11:09 /etc/profile.d/jdk.csh
-rwxr-xr-x 1 root root 146 Dec  9 11:09 /etc/profile.d/jdk.sh

ls -l /var/log/packages/*jdk*
-rw-r--r-- 1 root root 141353 Dec  9 11:11 /var/log/packages/jdk-8u65-i586-1_SBo

bash-4.2# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin

bash-4.2# whereis java
java: /usr/bin/java /usr/lib/java /usr/X11R6/bin/java /usr/bin/X11/java /usr/X11/bin/java /usr/share/java /usr/lib/java/bin/java /usr/lib/java/jre/bin/java /usr/lib/java/bin/java /usr/lib/java/jre/bin/java

bash-4.2# java -version
java version "1.5.0"
gij (GNU libgcj) version 4.8.2
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

It seems that even though I've removed the openjdk, then something is left.

phenixia2003 12-09-2015 06:58 AM

Hello,

what's the output of command :
Code:

ls -l /usr/bin/java
--
SeB

bassmadrigal 12-09-2015 07:16 AM

Quote:

Originally Posted by sababa.sababa (Post 5461834)
Code:

bash-4.2# java -version
java version "1.5.0"
gij (GNU libgcj) version 4.8.2
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


This doesn't even match openjdk, as on my system, java -version outputs 1.7.0_91. Based on your package version, Oracle's should output 1.8.0_65. Seems like it is using a seriously outdated version of java.

I'd try completely removing java, running those commands to make sure there's no stragglers, then try installing java again.

phenixia2003 12-09-2015 07:36 AM

Quote:

Originally Posted by bassmadrigal (Post 5461851)
This doesn't even match openjdk, as on my system, java -version outputs 1.7.0_91. Based on your package version, Oracle's should output 1.8.0_65. Seems like it is using a seriously outdated version of java.

I'd try completely removing java, running those commands to make sure there's no stragglers, then try installing java again.

The package gcc-java comes with a 1.5.0 JVM :
Code:

$ gij -version

java version "1.5.0"
gij (GNU libgcj) version 4.8.2

Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

It seems the OP has a symlink java -> /usr/bin/gij in one of the directories: /usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin

--
SeB

sababa.sababa 12-09-2015 08:01 AM

Code:

bash-4.2# ls -l /usr/bin/java
lrwxrwxrwx 1 root root 21 Dec  8 01:35 /usr/bin/java -> /usr/lib/jvm/bin/java

I foud this file: "/usr/lib/jvm/jre/bin/gij" that I temporarily moved away to another location. Thereafter reinstalled jdk and got this error:
Code:

bash-4.2# java
bash: java: command not found


phenixia2003 12-09-2015 08:35 AM

Hello,

Quote:

Originally Posted by sababa.sababa (Post 5461869)
Code:

bash-4.2# ls -l /usr/bin/java
lrwxrwxrwx 1 root root 21 Dec  8 01:35 /usr/bin/java -> /usr/lib/jvm/bin/java

I foud this file: "/usr/lib/jvm/jre/bin/gij" that I temporarily moved away to another location.

You only need to remove the symlink (as root):
Code:

$ rm /usr/bin/java
Quote:

Originally Posted by sababa.sababa (Post 5461869)
Thereafter reinstalled jdk and got this error:
Code:

bash-4.2# java
bash: java: command not found


Your environment is not correctly set.

Once you have installed java, you (really) need to logoff/logon to ensure the PATH is correctly set. If you don't want to logoff, you can run the command
Code:

. /etc/profile.d/jdk.sh
Then, the command java should work as expected.

--
SeB

sababa.sababa 12-09-2015 03:07 PM

Thanks a lot! Now it works perfectly!

sababa.sababa 12-13-2015 11:30 PM

I tried to use jarsigner but got an error. Could that error be related to my previous issue? I try to sign an apk package written in Kivy according to
https://groups.google.com/forum/#!to...rs/pBtbg8aSlNo
Here is the error:
Code:

bash-4.2$ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ./keystores/XYZ.keystore ./XyZ/bin/XYZ-0.0.1-release-unsigned.apk XyZ
Enter Passphrase for keystore:
jarsigner error: java.lang.RuntimeException: keystore load: Invalid keystore format


phenixia2003 12-14-2015 03:38 AM

Hello,

Quote:

Originally Posted by sababa.sababa (Post 5463876)
I tried to use jarsigner but got an error. Could that error be related to my previous issue? I try to sign an apk package written in Kivy according to
https://groups.google.com/forum/#!to...rs/pBtbg8aSlNo
Here is the error:
Code:

bash-4.2$ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ./keystores/XYZ.keystore ./XyZ/bin/XYZ-0.0.1-release-unsigned.apk XyZ
Enter Passphrase for keystore:
jarsigner error: java.lang.RuntimeException: keystore load: Invalid keystore format


jarsigner (and even keytool) returns this error when the keystore passed in argument is not of the default type (ie. JKS).

Maybe you have created the keystore :

1. with gcc/gcj keytool, which creates keystore of type gkr which is not recognized (AFAIK) by oracle/jdk.

2. with oracle/jdk keytool, but with another type like PKCS12, in which case, you can try to pass this type to jarsigner as below :
Code:

$ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ./keystores/XYZ.keystore -storetype pkcs12 ./XyZ/bin/XYZ-0.0.1-release-unsigned.apk XyZ
In case of (1) or if (2) does not work, the best would be to create a new keystore.


--
SeB

sababa.sababa 12-14-2015 10:50 PM

Thanks again! The problem seems to be solved with -storetype pkcs12, but now I get a new error:

Code:

$ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ./keystores/XYZ.keystore -storetype pkcs12 ./XyZ/bin/XYZ-0.0.1-release-unsigned.apk XyZ -storepass XYZ

jarsigner error: java.lang.RuntimeException: keystore load: toDerInputStream rejects tag type 71

Any ideas?

phenixia2003 12-15-2015 02:23 AM

Hello,

Quote:

Originally Posted by sababa.sababa (Post 5464398)
Thanks again! The problem seems to be solved with -storetype pkcs12, but now I get a new error:

Code:

$ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ./keystores/XYZ.keystore -storetype pkcs12 ./XyZ/bin/XYZ-0.0.1-release-unsigned.apk XyZ -storepass XYZ

jarsigner error: java.lang.RuntimeException: keystore load: toDerInputStream rejects tag type 71

Any ideas?

What's the output of command :
Code:

$ keytool -list -storetype pkcs12 -keystore ./keystores/XYZ.keystore
--
SeB


All times are GMT -5. The time now is 08:52 AM.