/srv/irclogs.ubuntu.com/2010/10/15/#ubuntu-java.txt

=== doko_ is now known as doko
gnagnohello all13:50
gnagnoI have a problem with java programs, if I run them as normal user they don't work, but if I run them with sudo they work, any solution?13:51
persiaPackaged programs or unpackaged programs?  If the former, which one?13:53
gnagnoany program13:55
gnagnonow I am trying with a simple "hello word"13:55
gnagnojust imagine I make a very simple program, compile it and any time I try to run it I have to use sudo13:55
persiaWhich JRE do you have installed?13:57
gnagnothis is the output from java -version13:59
gnagnojava version "1.6.0_20"13:59
gnagnoJava(TM) SE Runtime Environment (build 1.6.0_20-b02)13:59
gnagnoJava HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)13:59
persiaAnd that's installed from the package?13:59
persiaHrm.13:59
gnagnoyep13:59
persiaI've never heard of this issue before.13:59
persiaYou get "permission denied" when you try to run without sudo?13:59
gnagnono13:59
persiaWhat error do you get?13:59
gnagnothis: http://pastebin.com/1R7JDkLU14:00
gnagnodo you want I paste the log file too?14:00
nthykierdo your user have LD_LIBRARY_PATH or LD_PRELOAD set to anything?14:07
nthykierbut yes, it would be nice to see the log file as well14:08
nthykiergnagno: ^14:08
nthykierGah, my mouse just died on me >.< stupid battery14:08
* persia took too long and got "WE ARE CURRENTLY MOVING SERVERS, DUE TO THIS, A FEW PASTE ARE CURRENTLY OFFLINE, THEY WILL BE BACK IN A FEW MINUTES." :(14:09
gnagnowait wait... I discovered something strange14:09
gnagnonow my simple hello world app is working with normal user14:09
persiaOh, excellent.14:10
gnagnocan you please look at this one? http://pastebin.com/ZmX09u7914:10
gnagnoif I uncomment line #16 it is not working14:10
gnagnomaybe the problem is somehow related to some library?14:11
* persia gets the same error message14:11
nthykierooooooh, sounds like someone broke swing14:11
nthykiersmells like a bug report14:12
gnagnoand this is the content of the log file: http://pastebin.com/7abuwVrw14:12
gnagnoNetbeans is not working too... I have to lauch it as root14:13
gnagnopersia, did you get my same error message with my simple program?14:17
persiaYes, and my browser crashed.14:18
persiaBut I agree with nthykier: it's probably enough to file a bug report.14:18
nthykiergnagno: wait... why is your sun java using motif?14:20
nthykierI thought gtk+ was the backing implementation of Java on Linux in Ubuntu?14:21
gnagnonthykier, I don't know... I don't think I changed it14:22
gnagnohow can I change it back to gtk+ ?14:23
nthykierDon't know14:23
persiaOught be gtk14:23
nthykieryeah, it ought to be gtk... you definitely want to mention that it uses motif and not gtk in the bug report14:24
persiaIndeed.14:24
nthykierand then pass the bug number to persia so he can click the "I am also affected by this" button ;)14:25
persiaUm, except I'm not :)14:25
nthykier:)14:27
gnagnoI am googling to see if I can change this from motif to gtk14:31
gnagnoanyway don't you think it's strange that it's working with sudo and not with my normal user14:40
gnagno?14:40
persiaIt is strange, hence the request to file a bug.14:40
nthykierwell, that is kind of why I asked about the LD_PRELOAD and LD_LIBRARY_PATH, as I recall sudo unsets those before starting the application (since keeping them opens possible root exploits)14:43
nthykierthough I did not see anything in the crash log that suggests it was using non-standard libraries14:45
gnagnosomeone else have my same problem: http://ubuntuforums.org/archive/index.php/t-1257346.html14:47
nthykiererh, is the log supposed to say OS:squeeze/sid and not (e.g.) Maverick?14:48
nthykiers/log/crash log/14:49
nthykierHmm it does not really look like the method that crashes can crash14:53
gnagnowhy squeeze ? I am using Meverick14:59
nthykierYeah, Squeeze is the current development release of Debian... well, maybe Ubuntu has just imported the Debian package without changes and it is hardcoded into Java itself when it was built15:05
gnagnodo you think it is possible that the root user can access some libraries that my normal user cannot?15:06
gnagnoand this is why netbeans and swing programs are not working for my normal user?15:06
nthykierit is possible, but unless you have been messing with chmod/chown in /usr/lib/ and /lib then it is not very likely15:07
gnagnoactually I noticed that the program is raising the error in the moment I call hw.setVisible(true);15:07
nthykieryupe the log also suggests this is the case15:08
nthykierrather - it confirms this is the case (see "Java Frames:")15:09
patohello15:09
gnagnoso the problem is in the rendering moment15:09
gnagnohello pato15:09
nthykiergnagno: btw, do you experience this problem when using OpenJDK ?15:11
patosorry to bother today. I am having and issue when compiling through ireport and netbeans. Its all related to having the java driver installed15:11
patoI have it15:11
patobut it is like is not finding it at all15:11
patoit worked on fedora, but it justs fails on ubuntu15:12
patoanyone has any ideas?15:12
nthykiergnagno: btw, what exactly did you write when you start your application?15:12
gnagnonthykier, with openjdk it is working15:12
nthykierYay for open source software15:12
gnagnonthykier, do you mean what is the content of the app file?15:13
gnagnook I guess I can use openjdk :)15:13
nthykierthe app file?15:13
gnagnoyou asked me what exactly did you write when you start your application?15:14
gnagnowhat do you mean?15:14
nthykierwell, do you write "java $classname" or what?15:14
gnagnooh yes15:14
gnagnojava package.classname15:14
nthykierso java package.classname and sudo java package.classname ?15:15
gnagnoyep15:15
gnagnothe second one is working15:15
gnagnoactually netbeans is still not working, even with openjdk15:15
nthykierHmm, "which java" and "sudo which java" - do they output the same?15:16
gnagnoyes15:16
gnagnoI even tryed java -version and sudo java -version15:16
nthykierokay - just checking (sudo could also change the PATH)15:17
=== pato is now known as patojamriska
nthykierpatojamriska: : as in netbeans cannot find a java compiler?15:17
nthykieror netbeans fails to start?15:17
patojamriskano15:18
patojamriskathis is the error i get15:18
nthykiergnagno: hmm, what error does netbeans give you ?15:18
patojamriskaCaused by: java.sql.SQLException: No suitable driver found for jdbc:sqlserver://VMCITSMSQL2A:1433;DatabaseName=HDQUERY15:18
gnagnothis is netbeans error: http://pastebin.com/RC7Gxdkt15:19
patojamriskabut I have the driver there15:19
patojamriskaI can connect via a dicrect netbeans connection, but if I instanciate the driver with java.sql.drvier..... it just doen't work15:20
nthykierHmm, been a while since I last played with SQL drivers15:20
patojamriskawell, like I said, I just pointed the driver in the classpath in fedora, and it worked fine. I updated to ubuntu and all of a sudden I can't work because of this15:21
patojamriskaI been looking for an answer everywhere and no one seems to know15:21
nthykierIf the driver is from an Ubuntu package the jar may be named slightly different and be placed in /usr/share/java15:22
nthykiergnagno: same error with OpenJDK ?15:22
patojamriskaok let me check nt15:22
gnagnonthykier, this is with OpenJDK15:23
nthykier"/usr/lib/jvm/java-6-sun/bin/java" -Djdk.home="/usr/lib/jvm/java-6-sun"15:23
nthykierthat is not openjdk  :P15:23
gnagnouhm... I did update-java-alternatives15:24
nthykierpossible, but your local netbeans is still using sun java15:24
nthykiermaybe JAVA_HOME is set15:24
gnagnoyes, you're right15:24
patojamriskanaa, I still get the no suitable driver15:26
nthykierpatojamriska:  what is the package/jar you are using?15:26
patojamriskasqljdbc4.jar15:26
gnagnoI uncommented JAVA_HOME and netbeans is still using java-6-sun15:27
gnagnosorry, I meant I commented15:27
patojamriskagnagno: try to use the java command to change the default java15:28
nthykierpatojamriska: mmm, cannot see that jar being present in any java package I am aware of. did you download it from a third-party vendor?15:29
patojamriskayeah15:29
patojamriskagreat MSoft15:29
gnagnopatojamriska, how to use the java command to change the default java?15:30
patojamriskagnagno: sudo update-alternatives --config java15:30
nthykieractually you may find update-java-alternatives very convenient for changing system java15:31
gnagnothanks, I did it but netbeans is still using java-6-sun15:31
patojamriskanthykier: It shouldn't be tis hard, specially if you add the jar to the system and point it on the classpath15:31
patojamriskahmm15:31
nthykierpatojamriska: admittedly it should work the same on Ubuntu and Fedora15:32
patojamriskaexactly15:32
patojamriskaI got no idea why is not working15:32
patojamriskanow, If I deploy it to the server on tomcat, it works half ways sometimes15:32
patojamriskabecause I can't troubleshoot the report on NB15:33
nthykierNB?15:33
patojamriskanetbeans15:34
patojamriskaor iReport15:34
patojamriskaor pure java15:34
patojamriskanone do it15:34
patojamriska:(15:34
nthykierah netbeans15:34
nthykierI am an eclipse user15:34
nthykiernot used to all the netbeans related abbreviations :)15:35
nthykierhmm, does this sql jar have any dependencies?15:37
nthykieror is it a complete stand alone?15:37
patojamriskathat's ok15:37
patojamriskacomplete stand alone15:37
patojamriskaI wish ireport would have the plugin for eclipse15:37
nthykierokay - that rules out something being loaded on Fedora that was not loaded in Ubuntu15:37
nthykieryou could write one *hint hint*15:37
nthykierhehe15:37
patojamriska:)15:37
patojamriskayeah I been looking at the source and thinking about it15:38
patojamriskabut I am on a big project right now that does not give me much spare time for it15:38
nthykierbtw, are you using sun-java or OpenJDK?15:40
nthykieror even GCJ?15:40
nthykieralso, have you people tried using netbeans from Ubuntu - as I understand it Ubuntu got 6.9 in Maverick (haven't checked it though)15:42
patojamriskasorry I was lookign at the other screen15:48
patojamriska6.8 ubuntu15:48
patojamriskasun15:48
patojamriskaand openjdk15:48
patojamriskanone work15:48
patojamriskaand on fedora was working on both15:48
gnagnoI tryed now to install netbeans from package, still got the same error tought it installed a lot of dependencies15:50
nthykiergnagno: if the Ubuntu package does not respect your system settings for java (and you do not have JAVA_HOME set in your terminal/environment) then you should file a bug against it15:54
patojamriskaI hate to say this but I am going to have to install windows to work on this thing of netbeans for a while15:55
gnagnopatojamriska, I was going to say the same...15:55
nthykierfair enough15:56
gnagnoI just am not used to windows15:56
patojamriskai hate windows15:57
patojamriskai might as as well on the java forum and see if anyone has any ideas15:57
patojamriskathank you for your time though nt15:58
patojamriskaoh15:59
patojamriskacheck this out16:00
patojamriskaI changed the parameter to use the local connection on the report, and have another pointing to mysql and now I get this16:00
patojamriskaCaused by: java.sql.SQLException: No suitable driver found for jdbc:mysql://cedev/PartsInventoryDevelopment16:00
nthykiermm, we do have an mysql driver in Ubuntu last I checked - you probably have to tell netbeans where to find it though16:01
patojamriskais on my classpath16:01
nthykierbtw, those URLs looks "strange"16:02
patojamriskahow come?16:03
nthykierwell, regular URLs are read as protocol://host/resource but yours (ignored the jdbc: part) does not seem to have hostnames in them16:05
nthykieragain it is ages since I last looked at Java and SQL drivers :P16:06
patojamriskawell I use teh hostname of the dev machine == cedev16:06
patojamriskaand teh resource the database name16:06
patojamriskait works fine on the straight connections16:06
patojamriska:)16:06
nthykiersure :P16:07
patojamriskalol16:07
nthykierour university computers have aliases in their /etc/hosts file for all their machines, so I know that the URL could be valid... just that most setups do not use aliases like that :)16:10
gnagnoI am still fighting with java and swing16:11
nthykierI learned long ago that GUI programming is generally not me... I can do all the component logic and connect the events, but I cannot be bothered to create something that looks decent16:13
nthykiermmm... headless programs :P16:14
patojamriska:)16:22
patojamriskano luck16:31
patojamriskaim going to have to use windows16:31
gnagnopatojamriska, windows in evil17:04
persiaLet's not argue about how one or another operating system is bad.17:12
persiaArguing about why one or another is good, on the other hand, is less objectionable.17:12
persiaWe can always learn to improve :)17:12
gnagnopersia, of course I was irhonic :)17:15
gnagnoI just need to make swing work under ubuntu :/17:16
gnagnoI am leaving thank you very much for your help17:57
patojamriskaim out as well18:23
patojamriskai'll be back later18:23
patojamriskathanks for all the help18:23

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!