=== doko_ is now known as doko [13:50] hello all [13:51] I 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:53] Packaged programs or unpackaged programs? If the former, which one? [13:55] any program [13:55] now I am trying with a simple "hello word" [13:55] just imagine I make a very simple program, compile it and any time I try to run it I have to use sudo [13:57] Which JRE do you have installed? [13:59] this is the output from java -version [13:59] java version "1.6.0_20" [13:59] Java(TM) SE Runtime Environment (build 1.6.0_20-b02) [13:59] Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode) [13:59] And that's installed from the package? [13:59] Hrm. [13:59] yep [13:59] I've never heard of this issue before. [13:59] You get "permission denied" when you try to run without sudo? [13:59] no [13:59] What error do you get? [14:00] this: http://pastebin.com/1R7JDkLU [14:00] do you want I paste the log file too? [14:07] do your user have LD_LIBRARY_PATH or LD_PRELOAD set to anything? [14:08] but yes, it would be nice to see the log file as well [14:08] gnagno: ^ [14:08] Gah, my mouse just died on me >.< stupid battery [14:09] * 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] wait wait... I discovered something strange [14:09] now my simple hello world app is working with normal user [14:10] Oh, excellent. [14:10] can you please look at this one? http://pastebin.com/ZmX09u79 [14:10] if I uncomment line #16 it is not working [14:11] maybe the problem is somehow related to some library? [14:11] * persia gets the same error message [14:11] ooooooh, sounds like someone broke swing [14:12] smells like a bug report [14:12] and this is the content of the log file: http://pastebin.com/7abuwVrw [14:13] Netbeans is not working too... I have to lauch it as root [14:17] persia, did you get my same error message with my simple program? [14:18] Yes, and my browser crashed. [14:18] But I agree with nthykier: it's probably enough to file a bug report. [14:20] gnagno: wait... why is your sun java using motif? [14:21] I thought gtk+ was the backing implementation of Java on Linux in Ubuntu? [14:22] nthykier, I don't know... I don't think I changed it [14:23] how can I change it back to gtk+ ? [14:23] Don't know [14:23] Ought be gtk [14:24] yeah, it ought to be gtk... you definitely want to mention that it uses motif and not gtk in the bug report [14:24] Indeed. [14:25] and then pass the bug number to persia so he can click the "I am also affected by this" button ;) [14:25] Um, except I'm not :) [14:27] :) [14:31] I am googling to see if I can change this from motif to gtk [14:40] anyway don't you think it's strange that it's working with sudo and not with my normal user [14:40] ? [14:40] It is strange, hence the request to file a bug. [14:43] well, 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:45] though I did not see anything in the crash log that suggests it was using non-standard libraries [14:47] someone else have my same problem: http://ubuntuforums.org/archive/index.php/t-1257346.html [14:48] erh, is the log supposed to say OS:squeeze/sid and not (e.g.) Maverick? [14:49] s/log/crash log/ [14:53] Hmm it does not really look like the method that crashes can crash [14:59] why squeeze ? I am using Meverick [15:05] Yeah, 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 built [15:06] do you think it is possible that the root user can access some libraries that my normal user cannot? [15:06] and this is why netbeans and swing programs are not working for my normal user? [15:07] it is possible, but unless you have been messing with chmod/chown in /usr/lib/ and /lib then it is not very likely [15:07] actually I noticed that the program is raising the error in the moment I call hw.setVisible(true); [15:08] yupe the log also suggests this is the case [15:09] rather - it confirms this is the case (see "Java Frames:") [15:09] hello [15:09] so the problem is in the rendering moment [15:09] hello pato [15:11] gnagno: btw, do you experience this problem when using OpenJDK ? [15:11] sorry to bother today. I am having and issue when compiling through ireport and netbeans. Its all related to having the java driver installed [15:11] I have it [15:11] but it is like is not finding it at all [15:12] it worked on fedora, but it justs fails on ubuntu [15:12] anyone has any ideas? [15:12] gnagno: btw, what exactly did you write when you start your application? [15:12] nthykier, with openjdk it is working [15:12] Yay for open source software [15:13] nthykier, do you mean what is the content of the app file? [15:13] ok I guess I can use openjdk :) [15:13] the app file? [15:14] you asked me what exactly did you write when you start your application? [15:14] what do you mean? [15:14] well, do you write "java $classname" or what? [15:14] oh yes [15:14] java package.classname [15:15] so java package.classname and sudo java package.classname ? [15:15] yep [15:15] the second one is working [15:15] actually netbeans is still not working, even with openjdk [15:16] Hmm, "which java" and "sudo which java" - do they output the same? [15:16] yes [15:16] I even tryed java -version and sudo java -version [15:17] okay - just checking (sudo could also change the PATH) === pato is now known as patojamriska [15:17] patojamriska: : as in netbeans cannot find a java compiler? [15:17] or netbeans fails to start? [15:18] no [15:18] this is the error i get [15:18] gnagno: hmm, what error does netbeans give you ? [15:18] Caused by: java.sql.SQLException: No suitable driver found for jdbc:sqlserver://VMCITSMSQL2A:1433;DatabaseName=HDQUERY [15:19] this is netbeans error: http://pastebin.com/RC7Gxdkt [15:19] but I have the driver there [15:20] I can connect via a dicrect netbeans connection, but if I instanciate the driver with java.sql.drvier..... it just doen't work [15:20] Hmm, been a while since I last played with SQL drivers [15:21] well, 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 this [15:21] I been looking for an answer everywhere and no one seems to know [15:22] If the driver is from an Ubuntu package the jar may be named slightly different and be placed in /usr/share/java [15:22] gnagno: same error with OpenJDK ? [15:22] ok let me check nt [15:23] nthykier, this is with OpenJDK [15:23] "/usr/lib/jvm/java-6-sun/bin/java" -Djdk.home="/usr/lib/jvm/java-6-sun" [15:23] that is not openjdk :P [15:24] uhm... I did update-java-alternatives [15:24] possible, but your local netbeans is still using sun java [15:24] maybe JAVA_HOME is set [15:24] yes, you're right [15:26] naa, I still get the no suitable driver [15:26] patojamriska: what is the package/jar you are using? [15:26] sqljdbc4.jar [15:27] I uncommented JAVA_HOME and netbeans is still using java-6-sun [15:27] sorry, I meant I commented [15:28] gnagno: try to use the java command to change the default java [15:29] patojamriska: 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] yeah [15:29] great MSoft [15:30] patojamriska, how to use the java command to change the default java? [15:30] gnagno: sudo update-alternatives --config java [15:31] actually you may find update-java-alternatives very convenient for changing system java [15:31] thanks, I did it but netbeans is still using java-6-sun [15:31] nthykier: It shouldn't be tis hard, specially if you add the jar to the system and point it on the classpath [15:31] hmm [15:32] patojamriska: admittedly it should work the same on Ubuntu and Fedora [15:32] exactly [15:32] I got no idea why is not working [15:32] now, If I deploy it to the server on tomcat, it works half ways sometimes [15:33] because I can't troubleshoot the report on NB [15:33] NB? [15:34] netbeans [15:34] or iReport [15:34] or pure java [15:34] none do it [15:34] :( [15:34] ah netbeans [15:34] I am an eclipse user [15:35] not used to all the netbeans related abbreviations :) [15:37] hmm, does this sql jar have any dependencies? [15:37] or is it a complete stand alone? [15:37] that's ok [15:37] complete stand alone [15:37] I wish ireport would have the plugin for eclipse [15:37] okay - that rules out something being loaded on Fedora that was not loaded in Ubuntu [15:37] you could write one *hint hint* [15:37] hehe [15:37] :) [15:38] yeah I been looking at the source and thinking about it [15:38] but I am on a big project right now that does not give me much spare time for it [15:40] btw, are you using sun-java or OpenJDK? [15:40] or even GCJ? [15:42] also, have you people tried using netbeans from Ubuntu - as I understand it Ubuntu got 6.9 in Maverick (haven't checked it though) [15:48] sorry I was lookign at the other screen [15:48] 6.8 ubuntu [15:48] sun [15:48] and openjdk [15:48] none work [15:48] and on fedora was working on both [15:50] I tryed now to install netbeans from package, still got the same error tought it installed a lot of dependencies [15:54] gnagno: 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 it [15:55] I hate to say this but I am going to have to install windows to work on this thing of netbeans for a while [15:55] patojamriska, I was going to say the same... [15:56] fair enough [15:56] I just am not used to windows [15:57] i hate windows [15:57] i might as as well on the java forum and see if anyone has any ideas [15:58] thank you for your time though nt [15:59] oh [16:00] check this out [16:00] I changed the parameter to use the local connection on the report, and have another pointing to mysql and now I get this [16:00] Caused by: java.sql.SQLException: No suitable driver found for jdbc:mysql://cedev/PartsInventoryDevelopment [16:01] mm, we do have an mysql driver in Ubuntu last I checked - you probably have to tell netbeans where to find it though [16:01] is on my classpath [16:02] btw, those URLs looks "strange" [16:03] how come? [16:05] well, regular URLs are read as protocol://host/resource but yours (ignored the jdbc: part) does not seem to have hostnames in them [16:06] again it is ages since I last looked at Java and SQL drivers :P [16:06] well I use teh hostname of the dev machine == cedev [16:06] and teh resource the database name [16:06] it works fine on the straight connections [16:06] :) [16:07] sure :P [16:07] lol [16:10] our 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:11] I am still fighting with java and swing [16:13] I 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 decent [16:14] mmm... headless programs :P [16:22] :) [16:31] no luck [16:31] im going to have to use windows [17:04] patojamriska, windows in evil [17:12] Let's not argue about how one or another operating system is bad. [17:12] Arguing about why one or another is good, on the other hand, is less objectionable. [17:12] We can always learn to improve :) [17:15] persia, of course I was irhonic :) [17:16] I just need to make swing work under ubuntu :/ [17:57] I am leaving thank you very much for your help [18:23] im out as well [18:23] i'll be back later [18:23] thanks for all the help