Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsSetting up Bundle-RequiredExecutionEnvironment causes access restriction errors
https://www.eclipse.org/forums/index.php/mv/msg/110017/336139/#msg_336139
work. I decided to clean up my "No required execution environment has
been set" warnings. After adding the line
"Bundle-RequiredExecutionEnvironment: JavaSE-1.6" to all my plug-ins'
manefest files everything was OK except for one plug-in where I do some
XML manipulation using SAX2DOM and XPathAPI. In that class I get a bunch
of errors like this:
Access restriction: The constructor SAX2DOM() is not accessible due to
restriction on required library C:\Program
Files\Java\jdk1.6.0_13\jre\lib\rt.jar ReadClipboard.java com.lesliesoftware.wizardsfamiliar.deck.editor/src/com/lesli esoftware/wizardsfamiliar/deck/editor/clipboard line
230 Java Problem
When I edit the JRE System Library settings in the Project Properties |
Java Build Path | Libraries if I choose "Execution Environment JavaSE-1.6
(jdk1.6.0_13)" I get the compile errors. If I choose "Workspace default
JRE (jdk1.6.0_13)" the code compiles but I get an "The JRE container on
the classpath is not a perfect match to the 'JavaSE-1.6'" warning in my
mf file instead of the "No required execution environment has been set"
warning I am trying to fix.
Clearly my 1.6 JDK is a perfect match for the JavaSE-1.6 environment and
the preference page Java | Installed JREs | Execution Environment even
says as much. What is wrong with how I am trying to fix this?
Any help would be appreciated.
Ian
Code (I am using TagSoup to parse the HTML contents from the clip board
and then XPath to find content in the HTML to create my elements from):
---8<---
private void createSlotsFromHTMLTransfer (String contents) {
StringReader inputReader = null;
try {
// Create and configure the parser
Parser parser = new Parser ();
parser.setFeature
("http://xml.org/sax/features/namespace-prefixes", true); //$NON-NLS-1$
// Parse the HTML
SAX2DOM sax2dom = new SAX2DOM ();
parser.setContentHandler (sax2dom);
inputReader = new StringReader (contents);
InputSource inputSource = new InputSource (inputReader);
inputSource.setEncoding ("UTF-8"); //$NON-NLS-1$
parser.parse (inputSource);
Node doc = sax2dom.getDOM ();
if (TraceUtil.isOptionEnabled
(DebugOptions.CLIPBOARD_SAVEXML)) {
try {
// Prepare the DOM document for writing
Source source = new DOMSource(doc);
// Prepare the output file
File file = File.createTempFile ("clipboard", ".xml");
//$NON-NLS-1$ //$NON-NLS-2$
Result result = new StreamResult(file);
// Write the DOM document to the file
Transformer xformer =
TransformerFactory.newInstance().newTransformer();
xformer.transform(source, result);
--->8---]]>Ian Leslie2009-05-26T10:50:05-00:00(SOLVED - mostly) Re: Setting up Bundle-RequiredExecutionEnvironment causes...
https://www.eclipse.org/forums/index.php/mv/msg/110017/336186/#msg_336186
fact coming from an internal package and therefore I should not be using
it from there. I need to dl and setup Xalan so I can have public access
to that class - not rely on the fact that Sun used it internally. I wrote
that code in 2007 and did not realize I was even doing that. I guess the
access restriction actually was helpful.
The only thing that I do not understand is why when I choose "Workspace
default JRE (jdk1.6.0_13)" the code compiles without errors. Same JRE,
same access restrictions, same use of code I should not be.
Ian]]>Ian Leslie2009-05-28T12:08:14-00:00Re: (SOLVED - mostly) Re: Setting up Bundle-RequiredExecutionEnvironment causes...
https://www.eclipse.org/forums/index.php/mv/msg/110017/336198/#msg_336198
ian.leslie@lesliesoftware.com> wrote in message
news:7ccbca9a59f06068168b56515c0076c6$1@www.eclipse.org...
> Upon closer examination of the code I see that the SAX2DOM class is in
> fact coming from an internal package and therefore I should not be using
> it from there. I need to dl and setup Xalan so I can have public access
> to that class - not rely on the fact that Sun used it internally. I wrote
> that code in 2007 and did not realize I was even doing that. I guess the
> access restriction actually was helpful.
>
> The only thing that I do not understand is why when I choose "Workspace
> default JRE (jdk1.6.0_13)" the code compiles without errors. Same JRE,
> same access restrictions, same use of code I should not be.
Pointing to a JRE is less restrictive than pointing to a specific operating
environment, I think. I think that if you point to a JRE it'll take
whatever is in there, whereas if you specify an operating environment it
forces you to comply to the minimum definition of that environment, which
may not include all the libraries that are physically present.]]>Walter Harley2009-05-28T16:39:39-00:00Re: (SOLVED - mostly) Re: Setting up Bundle-RequiredExecutionEnvironment causes...
https://www.eclipse.org/forums/index.php/mv/msg/110017/336210/#msg_336210
the UI at the point were you choose the radio button between the default
JRE and the execution environment. But there is little point in
complaining about that. If I am setting up a specific execution
environment I should be well aware of that difference. In this case I
just was not:-)
Ian
Walter Harley wrote:
> "Ian Leslie" <ian.leslie@lesliesoftware.com> wrote in message
> I think that if you point to a JRE it'll take
> whatever is in there, whereas if you specify an operating environment it
> forces you to comply to the minimum definition of that environment, which
> may not include all the libraries that are physically present.]]>Ian Leslie2009-05-29T14:42:55-00:00