class Bouncy<T> extends Throwable {
}
// Error: the generic class Bouncy<T> may not subclass java.lang.Throwable
Why doesn't Java support generic Throwables?
Can somebody demonstrate how to send an array of bytes over a TCP connection from a sender program to a receiver program in Java. (I'm new to Java programming, and can't seem to find an example of how to do this that shows both ends of the connection (sender and receiver.) If you know of an existing example, maybe you could post the link. (No need to reinvent the wheel.) P.S. This is NOT homework! :-)
I have a Mac Java app bundle that has problems opening an OpenGL window from a SWT dialog in a single process. It just doesn't work.
To solve this problem I would like to open a SWT dialog in one instance of the Java app and then have it launch another instance of itself with a parameter saying "this time open the OpenGL window". The part I don't know how to do is finding out what "itself" is on a Mac.
How can I do that?
Hi all.
Can some one recommend a couple of good websites/bloogs/RSS/Podcasts where someone interested in Java can keep himself informed on the latest trends?
(I was thinking in something like Ajaxian.com for Java)
As always, help will be eternally appreciated.
Hi,
Anyone give example program which explains Java Threads in a simpler way.For example,we have the following threads t1 , t2 and t3 . Here I want code that shows each thread is executing simultaneously not sequentially like non-threaded java programs.
Thx
I've been convinced that I should learn another language (primarily PHP/Javascript oriented) and decided on Java.
I learned my basics of PHP, years ago, from www.w3schools.com and Javascript from another similar site (since taken down) that had a series of tutorials that took you from nothing to something.
Is there a similar site for Java? Is there a recommended IDE (Eclipse?) and site to learn?
i am doing a master project on how java applet works with web browsers.Can anyone give me details or any link that can be useful.How the web browser interacts with the java applet.
Basically I'm trying to proxy some webservices locally (for reasons I won't go into now) and then have a Java application call it.
I'm looking at BlazeDS since it seems to do just this, mostly to avoid the crossDomain.xml file required by Flex to call webservices. However I can't seem to find any reference on how to connect through a Java client (probably using Axis2).
Any suggestions, and especially tutorials, would be greatly appreciated.
I need a simple to use / good docs / good support java lib to read and write word documents, namely word 2007 support (and word 2010 support planned).
As the project I'm in has budget and time-constraints I don't mind buying a commercial lib :) I know they are XML files in a somewhat open format but I really don't want to waste time understanding the XML specification.
Any good recommendations from happy customers?
(Right now my choice is going to Aspose.Words for Java)
Hey,
I'd like to convert an array to a set in Java. There are some obvious ways of doing this (i.e. with a loop) but I would like something a bit neater, something like:
java.util.Arrays.asList(Object[] a);
Any ideas?
Cheers,
Pete
I know about C++ pure virtual classes, but Java went one step further and created a first-class (no pun intended) concept for multiple-interface (not implementation) inheritance, the interface. It's now a staple of major statically-typed languages. Did Java invent the interface concept? Or did it appear in older languages also as a first-class concept?
I'm using FreeMarker to generate java code, but as most of it is dynamically generated it's difficult to control the code formation.
I want to get code well formatted. Does anyone knows a lib or something like a pretty printer for java code?
Hello Guys
I am trying to access an Shellfolder like: "Shell:::{35786D3C-B075-49b9-88DD-029876E11C01}"
via Java on a Windows PC ... but I havn't found a way to do so up to now.
Is this generally possible with Java? Recently I uncovered the sun.awt class "ShellFolder"... Does this class provide the abilitiy to access such an folder?
thanks for your help Ripei
I need a media information extraction library (pure Java or JNI wrapper) that can handle common media formats. I primarily use it for video files and I need at least these information:
Video length (Runtime)
Video bitrate
Video framerate
Video format and codec
Video size (width X height)
Audio channels
Audio format
Audio bitrate and sampling rate
There are several libraries and tools around but I couldn't find for Java.
If I have a simple java program that processes lines of text from standard input, then I can run it with the following script:
@Echo off
java Test < file.txt
pause
exit
The script redirects lines of input from a separate file.
Is there a way that I can avoid having to use an extra file? Or is this the easiest way?
Thanks.
C# properties (I mean get and set methods) are a very useful feature. does java have something similar to C# properties too. I mean how we can implement something like the following C# code in java:
public string Name
{
get
{
return name;
}
set
{
name = value;
}
}
thank you in advance
So I am writing a Java code to represent a heap sort and to represent the operation I need to have a waiting function which will wait between different operation but I am not sure if there is a function in Java that does that or do I need to write the function by myself and how would i do that.
Representing heap sport is a homework but writing the waiting function isn't so I appreciate your help
Where can I get an opensource library written in java, especially for imap protocol.
For Example:
there is imaplib in python
likewise is there anything else in
java to replace that "imaplib"
Hi All,
I am a C# programmer. I want to learn Java to implement my windows application. But I don't know what IDE and what tools can help me.
Please help me to choose best platform and IDE and other tools.
Edit:
Thank You For Your Helping. And What is Best Ebooks and UserGuids to Learn java.
Can anyone recommend a light Java IDE that doesn't require you to make new projects each time you want to compile and run a program? I just want to be able to open java files and compile and run them. I have already tried Eclipse and NetBeans but both require you to make a new project each time you want to compile and run a program. Making a new project is fine for large scale projects but for small school assignments this just makes the process more tedious.
Thanks
Unfortunately, Java has no syntax for multi-line string literals. No problem if the IDE makes it easy to work with constructs like
String x = "CREATE TABLE TEST ( \n"
+ "A INTEGER NOT NULL PRIMARY KEY, \n"
...
What is the fastest way to paste a multi-line String from the clipboard into Java source using Eclipse (in a way that it automagically creates code like the above).
Started to learn LINQ with C#.
Especially LINQ to Objects and LINQ to XML.
I really enjoy the power of LINQ.
I learned that there is something called JLINQ a Jscript implementation.
Also (as Catbert posted) Scala will have LINQ
Do you know if LINQ or something similar will be a part of Java 7?
Update: Interesting post from 2008 - http://stackoverflow.com/questions/346721/linq-for-java
What is the easiest way to have an application launch at startup on Ubuntu server as daemon? This is a java application (java com.run.run.Run) etc.
How would I have it launch as a user and possibly have access to write to some log file where the user has permissions to write?
And if I don't end up doing that, how would I launch the application as the root user at startup.
Edited: It is a headless server, I don't have access to the desktop applications.
The database has data in UTC and when I try to get data
java.util.Calendar cal = Calendar.getInstance();
cal.setTimeZone(TimeZone.getTimeZone("UTC"));
java.sql.Timestamp ts = resultSet.getTimestamp(PUBLISH_TIME);
cal.setTime(ts);
Is there anything wrong with this?